diff --git a/src/openrct2/paint/support/MetalSupports.cpp b/src/openrct2/paint/support/MetalSupports.cpp index 0ada6ae3fd..45a83fef36 100644 --- a/src/openrct2/paint/support/MetalSupports.cpp +++ b/src/openrct2/paint/support/MetalSupports.cpp @@ -21,6 +21,56 @@ using namespace OpenRCT2; constexpr auto kMetalSupportSkip = 9 * 4 * 2; +// There are 13 types of metal support graphics, including rotated versions. A graphic showing all of them is available here: +// https://cloud.githubusercontent.com/assets/737603/19420485/7eaba28e-93ec-11e6-83cb-03190accc094.png +enum class MetalSupportGraphic : uint8_t +{ + /** + * Used by the Steel Twister, Looping RC, and other rides. + */ + Tubes = 0, + /** + * Used by the Junior RC and other rides. + */ + Fork = 1, + /** + * Rotated version of `Fork`. + */ + ForkAlt = 2, + /** + * Used by the vertical roller coasters, the Log Flume and other rides. + */ + Boxed = 3, + /** + * Used by the Steeplechase. + */ + Stick = 4, + /** + * No visible difference from `Stick`, also used by the Steeplechase + */ + StickAlt = 5, + /** + * Every “Thick” type seems to be used for the Looping Roller Coaster’s loop, and only for that specific part. + */ + ThickCentred = 6, + Thick = 7, + ThickAlt = 8, + ThickAltCentred = 9, + /** + * Used by the chairlift. + */ + Truss = 10, + /** + * Used by inverted rcs like the flying, lay-down, compact inverted. + * Mostly the same as `Tubes`, but with a thinner crossbeam. + */ + TubesInverted = 11, + /** + * Does not seem to be used in RCT2, but it was used in RCT1 for one of the path support types. + */ + BoxedCoated, +}; + /** rct2: 0x0097AF20, 0x0097AF21 */ // clang-format off static constexpr CoordsXY SupportBoundBoxes[] = { @@ -104,36 +154,36 @@ static constexpr CoordsXY _97B062[] = { /** rct2: 0x0097B072 */ static constexpr uint32_t _metalSupportTypeToCrossbeamImages[][8] = { - { 3370, 3371, 3370, 3371, 3372, 3373, 3372, 3373 }, // MetalSupportType::Tubes - { 3374, 3375, 3374, 3375, 3376, 3377, 3376, 3377 }, // MetalSupportType::Fork - { 3374, 3375, 3374, 3375, 3376, 3377, 3376, 3377 }, // MetalSupportType::ForkAlt - { 3370, 3371, 3370, 3371, 3372, 3373, 3372, 3373 }, // MetalSupportType::Boxed - { 3374, 3375, 3374, 3375, 3376, 3377, 3376, 3377 }, // MetalSupportType::Stick - { 3374, 3375, 3374, 3375, 3376, 3377, 3376, 3377 }, // MetalSupportType::StickAlt - { 3378, 3383, 3378, 3383, 3380, 3385, 3380, 3385 }, // MetalSupportType::ThickCentred - { 3378, 3383, 3378, 3383, 3380, 3385, 3380, 3385 }, // MetalSupportType::Thick - { 3382, 3379, 3382, 3379, 3384, 3381, 3384, 3381 }, // MetalSupportType::ThickAlt - { 3382, 3379, 3382, 3379, 3384, 3381, 3384, 3381 }, // MetalSupportType::ThickAltCentred - { 3378, 3379, 3378, 3379, 3380, 3381, 3380, 3381 }, // MetalSupportType::Truss - { 3386, 3387, 3386, 3387, 3388, 3389, 3388, 3389 }, // MetalSupportType::TubesInverted - { 3370, 3371, 3370, 3371, 3372, 3373, 3372, 3373 }, // MetalSupportType::BoxedCoated + { 3370, 3371, 3370, 3371, 3372, 3373, 3372, 3373 }, // MetalSupportGraphic::Tubes + { 3374, 3375, 3374, 3375, 3376, 3377, 3376, 3377 }, // MetalSupportGraphic::Fork + { 3374, 3375, 3374, 3375, 3376, 3377, 3376, 3377 }, // MetalSupportGraphic::ForkAlt + { 3370, 3371, 3370, 3371, 3372, 3373, 3372, 3373 }, // MetalSupportGraphic::Boxed + { 3374, 3375, 3374, 3375, 3376, 3377, 3376, 3377 }, // MetalSupportGraphic::Stick + { 3374, 3375, 3374, 3375, 3376, 3377, 3376, 3377 }, // MetalSupportGraphic::StickAlt + { 3378, 3383, 3378, 3383, 3380, 3385, 3380, 3385 }, // MetalSupportGraphic::ThickCentred + { 3378, 3383, 3378, 3383, 3380, 3385, 3380, 3385 }, // MetalSupportGraphic::Thick + { 3382, 3379, 3382, 3379, 3384, 3381, 3384, 3381 }, // MetalSupportGraphic::ThickAlt + { 3382, 3379, 3382, 3379, 3384, 3381, 3384, 3381 }, // MetalSupportGraphic::ThickAltCentred + { 3378, 3379, 3378, 3379, 3380, 3381, 3380, 3381 }, // MetalSupportGraphic::Truss + { 3386, 3387, 3386, 3387, 3388, 3389, 3388, 3389 }, // MetalSupportGraphic::TubesInverted + { 3370, 3371, 3370, 3371, 3372, 3373, 3372, 3373 }, // MetalSupportGraphic::BoxedCoated }; /** rct2: 0x0097B142 */ static constexpr uint8_t supportTypeToHeight[] = { - 6, // MetalSupportType::Tubes - 3, // MetalSupportType::Fork - 3, // MetalSupportType::ForkAlt - 6, // MetalSupportType::Boxed - 3, // MetalSupportType::Stick - 3, // MetalSupportType::StickAlt - 6, // MetalSupportType::ThickCentred - 6, // MetalSupportType::Thick - 6, // MetalSupportType::ThickAlt - 6, // MetalSupportType::ThickAltCentred - 4, // MetalSupportType::Truss - 3, // MetalSupportType::TubesInverted - 6, // MetalSupportType::BoxedCoated + 6, // MetalSupportGraphic::Tubes + 3, // MetalSupportGraphic::Fork + 3, // MetalSupportGraphic::ForkAlt + 6, // MetalSupportGraphic::Boxed + 3, // MetalSupportGraphic::Stick + 3, // MetalSupportGraphic::StickAlt + 6, // MetalSupportGraphic::ThickCentred + 6, // MetalSupportGraphic::Thick + 6, // MetalSupportGraphic::ThickAlt + 6, // MetalSupportGraphic::ThickAltCentred + 4, // MetalSupportGraphic::Truss + 3, // MetalSupportGraphic::TubesInverted + 6, // MetalSupportGraphic::BoxedCoated }; struct MetalSupportsImages { @@ -144,19 +194,19 @@ struct MetalSupportsImages { /** rct2: 0x0097B15C, 0x0097B190 */ static constexpr MetalSupportsImages kSupportBasesAndBeams[] = { - { 3243, 3209, 3226 }, // MetalSupportType::Tubes - { 3279, 3262, 3262 }, // MetalSupportType::Fork - { 3298, 3262, 3262 }, // MetalSupportType::ForkAlt - { 3334, 3317, 3317 }, // MetalSupportType::Boxed - { 0, 3658, 3658 }, // MetalSupportType::Stick - { 0, 3658, 3658 }, // MetalSupportType::StickAlt - { 0, 3141, 3141 }, // MetalSupportType::ThickCentred - { 0, 3158, 3158 }, // MetalSupportType::Thick - { 0, 3175, 3175 }, // MetalSupportType::ThickAlt - { 0, 3192, 3192 }, // MetalSupportType::ThickAltCentred - { 0, 3124, 3124 }, // MetalSupportType::Truss - { 3243, 3209, 3226 }, // MetalSupportType::TubesInverted - { 3334, 3353, 3353 }, // MetalSupportType::BoxedCoated + { 3243, 3209, 3226 }, // MetalSupportGraphic::Tubes + { 3279, 3262, 3262 }, // MetalSupportGraphic::Fork + { 3298, 3262, 3262 }, // MetalSupportGraphic::ForkAlt + { 3334, 3317, 3317 }, // MetalSupportGraphic::Boxed + { 0, 3658, 3658 }, // MetalSupportGraphic::Stick + { 0, 3658, 3658 }, // MetalSupportGraphic::StickAlt + { 0, 3141, 3141 }, // MetalSupportGraphic::ThickCentred + { 0, 3158, 3158 }, // MetalSupportGraphic::Thick + { 0, 3175, 3175 }, // MetalSupportGraphic::ThickAlt + { 0, 3192, 3192 }, // MetalSupportGraphic::ThickAltCentred + { 0, 3124, 3124 }, // MetalSupportGraphic::Truss + { 3243, 3209, 3226 }, // MetalSupportGraphic::TubesInverted + { 3334, 3353, 3353 }, // MetalSupportGraphic::BoxedCoated }; /** rct2: 0x0097B404 */ @@ -216,25 +266,28 @@ static constexpr MetalSupportPlace kMetalSupportPlacementRotated[][kNumOrthogona MetalSupportPlace::TopRightSide }, }; -constexpr uint8_t MetalSupportTypeCount = 13; -constexpr MetalSupportType kMetalSupportTypeRotated[MetalSupportTypeCount][kNumOrthogonalDirections] = { - { MetalSupportType::Tubes, MetalSupportType::Tubes, MetalSupportType::Tubes, MetalSupportType::Tubes }, - { MetalSupportType::Fork, MetalSupportType::ForkAlt, MetalSupportType::Fork, MetalSupportType::ForkAlt }, - { MetalSupportType::ForkAlt, MetalSupportType::Fork, MetalSupportType::ForkAlt, MetalSupportType::Fork }, - { MetalSupportType::Boxed, MetalSupportType::Boxed, MetalSupportType::Boxed, MetalSupportType::Boxed }, - { MetalSupportType::Stick, MetalSupportType::StickAlt, MetalSupportType::Stick, MetalSupportType::StickAlt }, - { MetalSupportType::StickAlt, MetalSupportType::Stick, MetalSupportType::StickAlt, MetalSupportType::Stick }, - { MetalSupportType::ThickCentred, MetalSupportType::ThickAltCentred, MetalSupportType::Thick, MetalSupportType::ThickAlt }, - { MetalSupportType::Thick, MetalSupportType::ThickAlt, MetalSupportType::ThickCentred, MetalSupportType::ThickAltCentred }, - { MetalSupportType::ThickAlt, MetalSupportType::ThickCentred, MetalSupportType::ThickAltCentred, MetalSupportType::Thick }, - { MetalSupportType::ThickAltCentred, MetalSupportType::Thick, MetalSupportType::ThickAlt, MetalSupportType::ThickCentred }, - { MetalSupportType::Truss, MetalSupportType::Truss, MetalSupportType::Truss, MetalSupportType::Truss }, - { MetalSupportType::TubesInverted, MetalSupportType::TubesInverted, MetalSupportType::TubesInverted, - MetalSupportType::TubesInverted }, - { MetalSupportType::BoxedCoated, MetalSupportType::BoxedCoated, MetalSupportType::BoxedCoated, - MetalSupportType::BoxedCoated }, +constexpr MetalSupportGraphic kMetalSupportGraphicRotated[kMetalSupportTypeCount][kNumOrthogonalDirections] = { + { MetalSupportGraphic::Tubes, MetalSupportGraphic::Tubes, MetalSupportGraphic::Tubes, MetalSupportGraphic::Tubes }, + { MetalSupportGraphic::Fork, MetalSupportGraphic::ForkAlt, MetalSupportGraphic::Fork, MetalSupportGraphic::ForkAlt }, + { MetalSupportGraphic::Boxed, MetalSupportGraphic::Boxed, MetalSupportGraphic::Boxed, MetalSupportGraphic::Boxed }, + { MetalSupportGraphic::Stick, MetalSupportGraphic::StickAlt, MetalSupportGraphic::Stick, MetalSupportGraphic::StickAlt }, + { MetalSupportGraphic::Thick, MetalSupportGraphic::ThickAlt, MetalSupportGraphic::ThickCentred, + MetalSupportGraphic::ThickAltCentred }, + { MetalSupportGraphic::Truss, MetalSupportGraphic::Truss, MetalSupportGraphic::Truss, MetalSupportGraphic::Truss }, + { MetalSupportGraphic::TubesInverted, MetalSupportGraphic::TubesInverted, MetalSupportGraphic::TubesInverted, + MetalSupportGraphic::TubesInverted }, + { MetalSupportGraphic::BoxedCoated, MetalSupportGraphic::BoxedCoated, MetalSupportGraphic::BoxedCoated, + MetalSupportGraphic::BoxedCoated }, }; +static bool MetalASupportsPaintSetup( + PaintSession& session, MetalSupportGraphic supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, + ImageId imageTemplate); +static bool MetalBSupportsPaintSetup( + PaintSession& session, MetalSupportGraphic supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, + ImageId imageTemplate); +static inline MetalSupportGraphic RotateMetalSupportGraphic(MetalSupportType supportType, Direction direction); + /** * Metal pole supports * @param supportType (edi) @@ -244,8 +297,8 @@ constexpr MetalSupportType kMetalSupportTypeRotated[MetalSupportTypeCount][kNumO * @param imageTemplate (ebp) * rct2: 0x00663105 */ -bool MetalASupportsPaintSetup( - PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, +static bool MetalASupportsPaintSetup( + PaintSession& session, MetalSupportGraphic supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, ImageId imageTemplate) { if (!(session.Flags & PaintSessionFlags::PassedSurface)) @@ -429,13 +482,21 @@ bool MetalASupportsPaintSetup( return true; } -bool MetalASupportsPaintSetupRotated( - PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, - int32_t special, int32_t height, ImageId imageTemplate) +bool MetalASupportsPaintSetup( + PaintSession& session, MetalSupportType supportType, MetalSupportPlace placement, int32_t special, int32_t height, + ImageId imageTemplate) { - supportTypeMember = kMetalSupportTypeRotated[EnumValue(supportTypeMember)][direction]; + auto supportGraphic = RotateMetalSupportGraphic(supportType, 0); + return MetalASupportsPaintSetup(session, supportGraphic, placement, special, height, imageTemplate); +} + +bool MetalASupportsPaintSetupRotated( + PaintSession& session, MetalSupportType supportType, MetalSupportPlace placement, Direction direction, int32_t special, + int32_t height, ImageId imageTemplate) +{ + auto supportGraphic = RotateMetalSupportGraphic(supportType, direction); placement = kMetalSupportPlacementRotated[EnumValue(placement)][direction]; - return MetalASupportsPaintSetup(session, supportTypeMember, placement, special, height, imageTemplate); + return MetalASupportsPaintSetup(session, supportGraphic, placement, special, height, imageTemplate); } /** @@ -450,8 +511,8 @@ bool MetalASupportsPaintSetupRotated( * * @return (Carry Flag) */ -bool MetalBSupportsPaintSetup( - PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, +static bool MetalBSupportsPaintSetup( + PaintSession& session, MetalSupportGraphic supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, ImageId imageTemplate) { if (!(session.Flags & PaintSessionFlags::PassedSurface)) @@ -621,29 +682,43 @@ bool MetalBSupportsPaintSetup( return false; // AND } -bool MetalBSupportsPaintSetupRotated( - PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, - int32_t special, int32_t height, ImageId imageTemplate) +bool MetalBSupportsPaintSetup( + PaintSession& session, MetalSupportType supportType, MetalSupportPlace placement, int32_t special, int32_t height, + ImageId imageTemplate) { - supportTypeMember = kMetalSupportTypeRotated[EnumValue(supportTypeMember)][direction]; + auto supportGraphic = RotateMetalSupportGraphic(supportType, 0); + return MetalBSupportsPaintSetup(session, supportGraphic, placement, special, height, imageTemplate); +} + +bool MetalBSupportsPaintSetupRotated( + PaintSession& session, MetalSupportType supportType, MetalSupportPlace placement, Direction direction, int32_t special, + int32_t height, ImageId imageTemplate) +{ + auto supportGraphic = RotateMetalSupportGraphic(supportType, direction); placement = kMetalSupportPlacementRotated[EnumValue(placement)][direction]; - return MetalBSupportsPaintSetup(session, supportTypeMember, placement, special, height, imageTemplate); + return MetalBSupportsPaintSetup(session, supportGraphic, placement, special, height, imageTemplate); +} + +static inline MetalSupportGraphic RotateMetalSupportGraphic(MetalSupportType supportType, Direction direction) +{ + assert(direction < kNumOrthogonalDirections); + return kMetalSupportGraphicRotated[EnumValue(supportType)][direction]; } void DrawSupportsSideBySide( - PaintSession& session, Direction direction, uint16_t height, ImageId colour, MetalSupportType type, int32_t special) + PaintSession& session, Direction direction, uint16_t height, ImageId colour, MetalSupportType supportType, int32_t special) { - type = kMetalSupportTypeRotated[EnumValue(type)][direction]; + auto graphic = RotateMetalSupportGraphic(supportType, direction); if (direction & 1) { - MetalASupportsPaintSetup(session, type, MetalSupportPlace::TopRightSide, special, height, colour); - MetalASupportsPaintSetup(session, type, MetalSupportPlace::BottomLeftSide, special, height, colour); + MetalASupportsPaintSetup(session, graphic, MetalSupportPlace::TopRightSide, special, height, colour); + MetalASupportsPaintSetup(session, graphic, MetalSupportPlace::BottomLeftSide, special, height, colour); } else { - MetalASupportsPaintSetup(session, type, MetalSupportPlace::TopLeftSide, special, height, colour); - MetalASupportsPaintSetup(session, type, MetalSupportPlace::BottomRightSide, special, height, colour); + MetalASupportsPaintSetup(session, graphic, MetalSupportPlace::TopLeftSide, special, height, colour); + MetalASupportsPaintSetup(session, graphic, MetalSupportPlace::BottomRightSide, special, height, colour); } } diff --git a/src/openrct2/paint/support/MetalSupports.h b/src/openrct2/paint/support/MetalSupports.h index cec5e65918..19e79a627b 100644 --- a/src/openrct2/paint/support/MetalSupports.h +++ b/src/openrct2/paint/support/MetalSupports.h @@ -14,55 +14,52 @@ #include -// There are 13 types of metal supports. A graphic showing all of them is available here: -// https://cloud.githubusercontent.com/assets/737603/19420485/7eaba28e-93ec-11e6-83cb-03190accc094.png -enum class MetalSupportType : uint8_t +using track_type_t = uint16_t; + +enum class MetalSupportType { /** * Used by the Steel Twister, Looping RC, and other rides. */ Tubes = 0, + /** * Used by the Junior RC and other rides. */ Fork = 1, - /** - * Rotated version of `Fork`. - */ - ForkAlt = 2, + /** * Used by the vertical roller coasters, the Log Flume and other rides. */ - Boxed = 3, + Boxed = 2, + /** * Used by the Steeplechase. */ - Stick = 4, + Stick = 3, + /** - * No visible difference from `Stick`, also used by the Steeplechase + * Used for the Looping Roller Coaster’s loop, and only for that specific part. */ - StickAlt = 5, - /** - * Every “Thick” type seems to be used for the Looping Roller Coaster’s loop, and only for that specific part. - */ - ThickCentred = 6, - Thick = 7, - ThickAlt = 8, - ThickAltCentred = 9, + Thick = 4, + /** * Used by the chairlift. */ - Truss = 10, + Truss = 5, + /** * Used by inverted rcs like the flying, lay-down, compact inverted. * Mostly the same as `Tubes`, but with a thinner crossbeam. */ - TubesInverted = 11, + TubesInverted = 6, + /** * Does not seem to be used in RCT2, but it was used in RCT1 for one of the path support types. */ - BoxedCoated, + BoxedCoated = 7, }; +constexpr uint8_t kMetalSupportTypeCount = 8; /** * Tiles are rendered at a 45 degree angle, with the corners on the top, bottom, left and right. @@ -94,18 +91,20 @@ enum class MetalSupportPlace : uint8_t struct FootpathPaintInfo; struct PaintSession; +/** @deprecated */ bool MetalASupportsPaintSetup( - PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, + PaintSession& session, MetalSupportType supportType, MetalSupportPlace placement, int32_t special, int32_t height, ImageId imageTemplate); bool MetalASupportsPaintSetupRotated( - PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, - int32_t special, int32_t height, ImageId imageTemplate); + PaintSession& session, MetalSupportType supportType, MetalSupportPlace placement, Direction direction, int32_t special, + int32_t height, ImageId imageTemplate); +/** @deprecated */ bool MetalBSupportsPaintSetup( - PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, + PaintSession& session, MetalSupportType supportType, MetalSupportPlace placement, int32_t special, int32_t height, ImageId imageTemplate); bool MetalBSupportsPaintSetupRotated( - PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, - int32_t special, int32_t height, ImageId imageTemplate); + PaintSession& session, MetalSupportType supportType, MetalSupportPlace placement, Direction direction, int32_t special, + int32_t height, ImageId imageTemplate); void DrawSupportsSideBySide( PaintSession& session, Direction direction, uint16_t height, ImageId colour, MetalSupportType type, int32_t special = 0); bool PathPoleSupportsPaintSetup( diff --git a/src/openrct2/paint/track/coaster/AlpineCoaster.cpp b/src/openrct2/paint/track/coaster/AlpineCoaster.cpp index e947bc10d0..69901abeb3 100644 --- a/src/openrct2/paint/track/coaster/AlpineCoaster.cpp +++ b/src/openrct2/paint/track/coaster/AlpineCoaster.cpp @@ -54,9 +54,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } } else @@ -78,9 +77,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -153,9 +151,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); } } else @@ -185,9 +182,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -234,9 +230,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 3, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } } else @@ -266,9 +261,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 3, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -315,9 +309,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 6, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } } else @@ -347,9 +340,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 6, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -416,9 +408,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -494,9 +485,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 0, height, + session.SupportColours); switch (direction) { case 2: @@ -557,9 +548,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -706,9 +696,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 0, height, + session.SupportColours); switch (direction) { case 2: @@ -769,9 +759,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -866,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, MetalSupportType::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, MetalSupportType::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( @@ -936,9 +919,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -1033,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, MetalSupportType::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, MetalSupportType::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( @@ -1217,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 9, height, - session.SupportColours); break; } } @@ -1245,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 9, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 9, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1394,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -1422,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1571,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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 2, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 2, height, + session.SupportColours); } PaintUtilSetSegmentSupportHeight( session, @@ -1750,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 8, height, - session.SupportColours); break; } } @@ -1778,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 8, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1924,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } @@ -1952,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2102,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } @@ -2130,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2201,9 +1998,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); PaintUtilSetSegmentSupportHeight( @@ -2246,9 +2042,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); PaintUtilSetSegmentSupportHeight( @@ -2305,9 +2100,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 3, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } if (direction == 0 || direction == 3) { @@ -2357,9 +2151,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 3, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } if (direction == 0 || direction == 3) { @@ -2409,9 +2202,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 6, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } if (direction == 0 || direction == 3) { @@ -2461,9 +2253,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 6, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } if (direction == 0 || direction == 3) { @@ -2535,9 +2326,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); PaintUtilSetSegmentSupportHeight( @@ -2625,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2734,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2843,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2952,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3061,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3170,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3279,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3388,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3494,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3601,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3711,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3820,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3925,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4030,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4099,9 +3693,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 2, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 2, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -4180,9 +3773,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 2, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 2, height, + session.SupportColours); switch (direction) { case 2: @@ -4246,9 +3839,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 1, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 1, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -4398,9 +3990,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 1, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 1, height, + session.SupportColours); switch (direction) { case 2: @@ -4461,9 +4053,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -4558,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, MetalSupportType::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, MetalSupportType::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( @@ -4628,9 +4212,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -4725,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, MetalSupportType::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, MetalSupportType::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( @@ -4811,9 +4387,8 @@ namespace OpenRCT2::AlpineRC { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -4858,9 +4433,9 @@ namespace OpenRCT2::AlpineRC { 6, 0, height }, { 20, 32, 3 }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 8, height, + session.SupportColours); switch (direction) { case 2: @@ -4913,9 +4488,8 @@ namespace OpenRCT2::AlpineRC { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -4943,31 +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, MetalSupportType::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, MetalSupportType::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: @@ -5036,9 +4605,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -5185,9 +4753,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 8, height, + session.SupportColours); switch (direction) { case 2: @@ -5240,9 +4808,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -5389,9 +4956,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 8, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 8, height, + session.SupportColours); switch (direction) { case 0: @@ -5460,9 +5027,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -5491,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, MetalSupportType::ForkAlt, MetalSupportPlace::TopRightSide, 1, height - 1, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 1, height - 1, session.SupportColours); break; case 2: @@ -5540,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, MetalSupportType::ForkAlt, MetalSupportPlace::TopRightSide, 1, height - 1, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 1, height - 1, session.SupportColours); break; } @@ -5579,9 +5145,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 1: @@ -5634,9 +5199,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -5665,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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height, session.SupportColours); break; case 2: @@ -5714,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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height, session.SupportColours); break; } @@ -5753,9 +5317,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 1: @@ -5811,9 +5374,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 5, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 5, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -5892,9 +5454,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 9, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 9, height, + session.SupportColours); switch (direction) { case 2: @@ -5941,9 +5503,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 5, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 5, height, + session.SupportColours); switch (direction) { case 0: @@ -6027,9 +5589,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 9, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::StandardFlat); @@ -6080,9 +5641,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 5, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 5, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -6161,9 +5721,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 9, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 9, height, + session.SupportColours); switch (direction) { case 0: @@ -6210,9 +5770,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 5, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 5, height, + session.SupportColours); switch (direction) { case 2: @@ -6296,9 +5856,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 9, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::StandardFlat); @@ -6375,9 +5934,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 3, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -6527,9 +6085,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 9, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 9, height, + session.SupportColours); switch (direction) { case 2: @@ -6576,9 +6134,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 3, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 3, height, + session.SupportColours); switch (direction) { case 0: @@ -6733,9 +6291,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 9, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::StandardFlat); @@ -6785,9 +6342,8 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 3, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -6917,8 +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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -6927,24 +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, MetalSupportType::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: @@ -6991,9 +6542,9 @@ namespace OpenRCT2::AlpineRC { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 3, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 3, height, + session.SupportColours); switch (direction) { case 2: @@ -7131,31 +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, MetalSupportType::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, MetalSupportType::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); @@ -7220,9 +6766,8 @@ namespace OpenRCT2::AlpineRC } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); PaintUtilSetSegmentSupportHeight( @@ -7263,9 +6808,8 @@ namespace OpenRCT2::AlpineRC { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 3, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -7310,9 +6854,9 @@ namespace OpenRCT2::AlpineRC { 6, 0, height }, { { 0, 6, height - 6 }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 10, - height - 6, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 10, height - 6, + session.SupportColours); switch (direction) { case 2: @@ -7368,9 +6912,8 @@ namespace OpenRCT2::AlpineRC { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 3, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -7415,9 +6958,9 @@ namespace OpenRCT2::AlpineRC { 6, 0, height }, { { 0, 6, height - 6 }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 10, - height - 6, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 10, height - 6, + session.SupportColours); switch (direction) { case 0: @@ -7470,9 +7013,8 @@ namespace OpenRCT2::AlpineRC { 0, 6, height }, { { 0, 6, height - 6 }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 8, - height - 6, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height - 6, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardSlopeEnd); @@ -7520,9 +7062,9 @@ namespace OpenRCT2::AlpineRC { 6, 0, height }, { 20, 32, 3 }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 5, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 5, height, + session.SupportColours); switch (direction) { case 2: @@ -7575,9 +7117,8 @@ namespace OpenRCT2::AlpineRC { 0, 6, height }, { { 0, 6, height - 6 }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 8, - height - 6, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height - 6, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardSlopeEnd); @@ -7625,9 +7166,9 @@ namespace OpenRCT2::AlpineRC { 6, 0, height }, { 20, 32, 3 }); break; } - MetalASupportsPaintSetup( - session, direction & 1 ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 5, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 5, height, + session.SupportColours); switch (direction) { case 0: diff --git a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp index 7b4115c43a..cb6ea01d14 100644 --- a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp @@ -158,7 +158,8 @@ static void classicStandUpRCTrackFlatToLeftBank( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -182,7 +183,8 @@ static void classicStandUpRCTrackFlatToRightBank( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -224,7 +226,8 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 0: @@ -363,7 +366,8 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 1 || direction == 0) { PaintUtilPushTunnelRotated(session, direction ^ 1, height, TunnelType::StandardFlat); @@ -409,7 +413,8 @@ static void classicStandUpRCTrackLeftBankTo25DegUp( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } if (direction == 0 || direction == 3) @@ -440,7 +445,8 @@ static void classicStandUpRCTrackRightBankTo25DegUp( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } if (direction == 0 || direction == 3) @@ -471,7 +477,8 @@ static void classicStandUpRCTrack25DegUpToLeftBank( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } if (direction == 0 || direction == 3) @@ -502,7 +509,8 @@ static void classicStandUpRCTrack25DegUpToRightBank( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } if (direction == 0 || direction == 3) @@ -565,7 +573,8 @@ static void classicStandUpRCTrackLeftBank( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -606,7 +615,8 @@ static void classicStandUpRCTrackLeftEighthBankToDiag( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -759,7 +769,8 @@ static void classicStandUpRCTrackRightEighthBankToDiag( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -928,7 +939,8 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 0: @@ -982,7 +994,8 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 1) { PaintUtilPushTunnelRotated(session, direction ^ 1, height, TunnelType::StandardFlat); diff --git a/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp index 2fc0a19b82..fe74a80a6c 100644 --- a/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp @@ -88,7 +88,8 @@ static void CorkscrewRCTrackFlat( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } } else @@ -110,7 +111,8 @@ static void CorkscrewRCTrackFlat( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -185,7 +187,8 @@ static void CorkscrewRCTrack25DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); } } else @@ -215,7 +218,8 @@ static void CorkscrewRCTrack25DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -262,7 +266,8 @@ static void CorkscrewRCTrack60DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 32, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 32, height, session.SupportColours); } } else @@ -292,7 +297,8 @@ static void CorkscrewRCTrack60DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 32, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 32, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -339,7 +345,8 @@ static void CorkscrewRCTrackFlatTo25DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } } else @@ -369,7 +376,8 @@ static void CorkscrewRCTrackFlatTo25DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -422,7 +430,8 @@ static void CorkscrewRCTrack25DegUpTo60DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); } } else @@ -458,7 +467,8 @@ static void CorkscrewRCTrack25DegUpTo60DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -511,7 +521,8 @@ static void CorkscrewRCTrack60DegUpTo25DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 20, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 20, height, session.SupportColours); } } else @@ -547,7 +558,8 @@ static void CorkscrewRCTrack60DegUpTo25DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 20, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 20, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -594,7 +606,8 @@ static void CorkscrewRCTrack25DegUpToFlat( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } } else @@ -624,7 +637,8 @@ static void CorkscrewRCTrack25DegUpToFlat( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } } if (direction == 0 || direction == 3) @@ -718,7 +732,8 @@ static void CorkscrewRCTrackLeftQuarterTurn5( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -865,7 +880,8 @@ static void CorkscrewRCTrackLeftQuarterTurn5( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 2: @@ -933,7 +949,8 @@ static void CorkscrewRCTrackFlatToLeftBank( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + 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); @@ -976,7 +993,8 @@ static void CorkscrewRCTrackFlatToRightBank( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + 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); @@ -1019,7 +1037,8 @@ static void CorkscrewRCTrackLeftBankToFlat( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + 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); @@ -1062,7 +1081,8 @@ static void CorkscrewRCTrackRightBankToFlat( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + 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); @@ -1103,7 +1123,8 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -1253,7 +1274,8 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 2: @@ -1322,7 +1344,8 @@ static void CorkscrewRCTrackLeftBankTo25DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } if (direction == 0 || direction == 3) { @@ -1372,7 +1395,8 @@ static void CorkscrewRCTrackRightBankTo25DegUp( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 3, height, session.SupportColours); } if (direction == 0 || direction == 3) { @@ -1422,7 +1446,8 @@ static void CorkscrewRCTrack25DegUpToLeftBank( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } if (direction == 0 || direction == 3) { @@ -1472,7 +1497,8 @@ static void CorkscrewRCTrack25DegUpToRightBank( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } if (direction == 0 || direction == 3) { @@ -1548,7 +1574,8 @@ static void CorkscrewRCTrackLeftBank( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + 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); @@ -1594,7 +1621,8 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -1736,7 +1764,8 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); switch (direction) { case 2: @@ -1790,7 +1819,8 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -1931,7 +1961,8 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); switch (direction) { case 0: @@ -2005,7 +2036,8 @@ static void CorkscrewRCTrackSBendLeft( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -2116,7 +2148,8 @@ static void CorkscrewRCTrackSBendLeft( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 1: @@ -2170,7 +2203,8 @@ static void CorkscrewRCTrackSBendRight( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -2281,7 +2315,8 @@ static void CorkscrewRCTrackSBendRight( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 1: @@ -2640,7 +2675,8 @@ static void CorkscrewRCTrackRightVerticalLoop( session, direction, session.TrackColours.WithIndex(16578), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -2829,7 +2865,8 @@ static void CorkscrewRCTrackRightVerticalLoop( session, direction, session.TrackColours.WithIndex(16585), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); switch (direction) { case 1: @@ -2877,7 +2914,8 @@ static void CorkscrewRCTrackLeftQuarterTurn3( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -2953,7 +2991,8 @@ static void CorkscrewRCTrackLeftQuarterTurn3( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 2: @@ -3019,7 +3058,8 @@ static void CorkscrewRCTrackLeftQuarterTurn3Bank( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -3098,7 +3138,8 @@ static void CorkscrewRCTrackLeftQuarterTurn3Bank( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 2: @@ -3157,7 +3198,8 @@ static void CorkscrewRCTrackLeftQuarterTurn325DegUp( session, direction, session.TrackColours.WithIndex(16539), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -3198,7 +3240,8 @@ static void CorkscrewRCTrackLeftQuarterTurn325DegUp( session, direction, session.TrackColours.WithIndex(16538), { 6, 0, height }, { 20, 32, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); switch (direction) { case 2: @@ -3248,7 +3291,8 @@ static void CorkscrewRCTrackRightQuarterTurn325DegUp( session, direction, session.TrackColours.WithIndex(16536), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -3366,7 +3410,8 @@ static void CorkscrewRCTrackHalfLoopUp( session, direction, session.TrackColours.WithIndex(16609), { 0, 6, height }, { 32, 20, 7 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -3628,7 +3673,8 @@ static void CorkscrewRCTrackRightCorkscrewUp( { { 0, 6, height + 4 }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -3770,7 +3816,8 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 2, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 2, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -3849,7 +3896,8 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( { { 6, 0, height + 8 }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); switch (direction) { case 2: @@ -3896,7 +3944,8 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 2, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 2, height, session.SupportColours); switch (direction) { case 0: @@ -3980,7 +4029,8 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::StandardFlat); @@ -4032,7 +4082,8 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 2, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 2, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -4111,7 +4162,8 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); switch (direction) { case 0: @@ -4158,7 +4210,8 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 2, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 2, height, session.SupportColours); switch (direction) { case 2: @@ -4242,7 +4295,8 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( { { 0, 6, height + 8 }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::StandardFlat); @@ -4324,7 +4378,8 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 1, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 1, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -4474,7 +4529,8 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( { { 6, 0, height + 8 }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); switch (direction) { case 2: @@ -4521,7 +4577,8 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 1, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 1, height, session.SupportColours); switch (direction) { case 0: @@ -4675,7 +4732,8 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::StandardFlat); @@ -4727,7 +4785,8 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 1, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 1, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -4876,7 +4935,8 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); switch (direction) { case 0: @@ -4923,7 +4983,8 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( { { 6, 0, height }, { 20, 32, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 1, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 1, height, session.SupportColours); switch (direction) { case 2: @@ -5078,7 +5139,8 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( { { 0, 6, height + 8 }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::StandardFlat); @@ -5258,7 +5320,8 @@ static void CorkscrewRCTrackBrakes( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + 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); @@ -5660,7 +5723,8 @@ static void CorkscrewRCTrackLeftEighthToDiag( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -5824,7 +5888,8 @@ static void CorkscrewRCTrackRightEighthToDiag( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -6006,7 +6071,8 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( { { 0, 6, height }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -6170,7 +6236,8 @@ static void CorkscrewRCTrackRightEighthBankToDiag( { { 0, 27, height }, { 32, 1, 26 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -9826,7 +9893,8 @@ static void CorkscrewRCTrackBlockBrakes( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(kCorkscrewRcBlockBrakeImages[direction][isClosed]), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + 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); @@ -9870,7 +9938,8 @@ static void CorkscrewRCTrackBooster( } if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + 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); @@ -9903,7 +9972,8 @@ static void CorkscrewRCTrackLeftTwistDownToUp( session, direction, session.TrackColours.WithIndex(26977), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -9976,7 +10046,8 @@ static void CorkscrewRCTrackLeftTwistDownToUp( PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { @@ -10018,7 +10089,8 @@ static void CorkscrewRCTrackRightTwistDownToUp( session, direction, session.TrackColours.WithIndex(26989), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -10091,7 +10163,8 @@ static void CorkscrewRCTrackRightTwistDownToUp( PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { @@ -10141,7 +10214,8 @@ static void CorkscrewRCTrackLeftTwistUpToDown( PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { @@ -10199,7 +10273,8 @@ static void CorkscrewRCTrackLeftTwistUpToDown( session, direction, session.TrackColours.WithIndex(26978), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 1: @@ -10256,7 +10331,8 @@ static void CorkscrewRCTrackRightTwistUpToDown( PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { @@ -10314,7 +10390,8 @@ static void CorkscrewRCTrackRightTwistUpToDown( session, direction, session.TrackColours.WithIndex(26990), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 1: @@ -10364,7 +10441,8 @@ static void LayDownRCTrackLeftFlyerTwistUp( session, direction, session.TrackColours.WithIndex(26977), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -10484,7 +10562,8 @@ static void LayDownRCTrackRightFlyerTwistUp( session, direction, session.TrackColours.WithIndex(26989), { 0, 6, height }, { 32, 20, 3 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -10602,7 +10681,8 @@ static void LayDownRCTrackFlyerHalfLoopUp( session, direction, session.TrackColours.WithIndex(16609), { 0, 6, height }, { 32, 20, 7 }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -10751,7 +10831,8 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( direction), 0xFFFF, 0); } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction != 2) { PaintUtilSetSegmentSupportHeight( @@ -10878,7 +10959,8 @@ static void LayDownRCTrackRightFlyerCorkscrewUp( { { 0, 6, height + 4 }, { 32, 20, 3 } }); break; } - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); diff --git a/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp b/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp index 9c8ff8547f..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, MetalSupportType::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 786c72307a..7eafa56cb6 100644 --- a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp @@ -1865,9 +1865,8 @@ static void JuniorRCPaintTrackFlat( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( @@ -2064,14 +2063,13 @@ static void JuniorRCRightQuarterTurn5TilesPaintSetup( switch (trackSequence) { case 0: - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - supportHeight, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, supportHeight, session.SupportColours); break; case 6: - MetalASupportsPaintSetup( - session, (direction & 1) ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 0, - supportHeight, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 0, supportHeight, + session.SupportColours); break; } @@ -2373,14 +2371,13 @@ static void JuniorRCBankedRightQuarterTurn5TilesPaintSetup( switch (trackSequence) { case 0: - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, - supportHeight, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, supportHeight, session.SupportColours); break; case 6: - MetalASupportsPaintSetup( - session, (direction & 1) ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 0, - supportHeight, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 0, supportHeight, + session.SupportColours); break; } @@ -2839,14 +2836,14 @@ static void JuniorRCPaintTrackLeftQuarterTurn5Tiles25DegUp( switch (trackSequence) { case 0: - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, - (direction == 0 || direction == 3) ? 10 : 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, (direction == 0 || direction == 3) ? 10 : 8, + height, session.SupportColours); break; case 6: - MetalASupportsPaintSetup( - session, (direction & 1) ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, - supportSpecial[direction], height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), supportSpecial[direction], + height, session.SupportColours); break; } @@ -2944,13 +2941,13 @@ static void JuniorRCPaintTrackRightQuarterTurn5Tiles25DegUp( switch (trackSequence) { case 0: - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, - supportSpecial[direction], height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, supportSpecial[direction], height, + session.SupportColours); break; case 6: - MetalASupportsPaintSetup( - session, (direction & 1) ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 8, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 8, height, session.SupportColours); break; } @@ -3096,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 { @@ -3119,22 +3100,21 @@ static void JuniorRCSBendLeftPaintSetup( { PaintUtilPushTunnelRight(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::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; @@ -3206,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 { @@ -3229,22 +3193,22 @@ static void JuniorRCSBendRightPaintSetup( { PaintUtilPushTunnelRight(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::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; @@ -3662,15 +3626,13 @@ static void JuniorRCRightHalfBankedHelixUpSmallPaintSetup( if (trackSequence == 0) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 2, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 2, height, session.SupportColours); } else if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 6, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 6, height, session.SupportColours); } if (direction == 0 && trackSequence == 0) @@ -3735,15 +3697,13 @@ static void JuniorRCRightHalfBankedHelixDownSmallPaintSetup( if (trackSequence == 0) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 6, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } else if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 2, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 2, height, session.SupportColours); } if (direction == 0 && trackSequence == 0) @@ -3840,15 +3800,13 @@ static void JuniorRCRightHalfBankedHelixUpLargePaintSetup( if (trackSequence == 0) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 1, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 1, height, session.SupportColours); } else if (trackSequence == 6) { - MetalASupportsPaintSetup( - session, (direction & 1) ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 7, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 7, height, session.SupportColours); } if (direction == 0 && trackSequence == 0) @@ -3947,15 +3905,13 @@ static void JuniorRCRightHalfBankedHelixDownLargePaintSetup( if (trackSequence == 0) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 7, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); } else if (trackSequence == 6) { - MetalASupportsPaintSetup( - session, (direction & 1) ? supportType.metal : MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 1, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 1, height, session.SupportColours); } if (direction == 0 && trackSequence == 0) @@ -4155,23 +4111,13 @@ static void JuniorRCLeftEighthToDiagPaintSetup( switch (trackSequence) { case 0: - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); break; case 4: - if (direction == 0) - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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; } @@ -4228,23 +4174,13 @@ static void JuniorRCRightEighthToDiagPaintSetup( switch (trackSequence) { case 0: - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); break; case 4: - if (direction == 0) - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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; } @@ -4400,23 +4336,12 @@ static void JuniorRCLeftEighthToDiagBankPaintSetup( switch (trackSequence) { case 0: - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + 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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 0, height, session.SupportColours); break; } @@ -4554,23 +4479,12 @@ static void JuniorRCRightEighthToDiagBankPaintSetup( switch (trackSequence) { case 0: - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 0, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + 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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); break; } @@ -4654,9 +4568,8 @@ static void JuniorRCTrackDiagBrakes( if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4674,9 +4587,8 @@ static void JuniorRCTrackDiagBlockBrakes( if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4696,9 +4608,8 @@ static void JuniorRCPaintTrackDiag25DegUp( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 8, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4718,9 +4629,8 @@ static void JuniorRCPaintTrackDiagFlatTo25DegUp( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4741,9 +4651,8 @@ static void JuniorRCPaintTrackDiagFlatTo60DegUp( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height + 6, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 6, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4763,9 +4672,8 @@ static void JuniorRCPaintTrackDiag25DegUpToFlat( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 4, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4786,9 +4694,8 @@ static void JuniorRCPaintTrackDiag60DegUpToFlat( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 4, - height + 13, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height + 13, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4808,9 +4715,8 @@ static void JuniorRCPaintTrackDiag25DegDown( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 8, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4830,9 +4736,8 @@ static void JuniorRCPaintTrackDiagFlatTo25DegDown( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 4, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4853,9 +4758,8 @@ static void JuniorRCPaintTrackDiagFlatTo60DegDown( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 4, - height + 7, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height + 7, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4875,9 +4779,8 @@ static void JuniorRCPaintTrackDiag25DegDownToFlat( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4898,9 +4801,8 @@ static void JuniorRCPaintTrackDiag60DegDownToFlat( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4925,9 +4827,8 @@ static void JuniorRCDiagFlatToLeftBankPaintSetup( } if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4952,9 +4853,8 @@ static void JuniorRCDiagFlatToRightBankPaintSetup( } if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4979,9 +4879,8 @@ static void JuniorRCDiagLeftBankToFlatPaintSetup( } if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5006,9 +4905,8 @@ static void JuniorRCDiagRightBankToFlatPaintSetup( } if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5033,9 +4931,8 @@ static void JuniorRCDiagLeftBankTo25DegUpPaintSetup( } if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5060,9 +4957,8 @@ static void JuniorRCDiagRightBankTo25DegUpPaintSetup( } if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5087,9 +4983,8 @@ static void JuniorRCDiag25DegUpToLeftBankPaintSetup( } if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 4, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5114,9 +5009,8 @@ static void JuniorRCDiag25DegUpToRightBankPaintSetup( } if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 4, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5141,9 +5035,8 @@ static void JuniorRCDiagLeftBankTo25DegDownPaintSetup( } if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 4, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5168,9 +5061,8 @@ static void JuniorRCDiagRightBankTo25DegDownPaintSetup( } if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 4, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5195,9 +5087,8 @@ static void JuniorRCDiag25DegDownToLeftBankPaintSetup( } if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5222,9 +5113,8 @@ static void JuniorRCDiag25DegDownToRightBankPaintSetup( } if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5258,9 +5148,8 @@ static void JuniorRCDiagLeftBankPaintSetup( if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5280,9 +5169,8 @@ static void JuniorRCDiagRightBankPaintSetup( if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 0, - height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5351,9 +5239,9 @@ static void JuniorRCPaintTrack60DegUp( static constexpr int8_t support[4] = { 35, 29, 25, 32 }; if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, - support[direction & 3], height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, support[direction & 3], height, + session.SupportColours); } PaintUtilSetSegmentSupportHeight( @@ -5437,9 +5325,9 @@ static void JuniorRCPaintTrack25DegUpTo60DegUp( static constexpr int8_t support[4] = { 12, 12, 12, 14 }; if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, - support[direction & 3], height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, support[direction & 3], height, + session.SupportColours); } PaintUtilSetSegmentSupportHeight( @@ -5501,9 +5389,8 @@ static void JuniorRCPaintTrack60DegUpTo25DegUp( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 20, height, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 20, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( @@ -5534,9 +5421,8 @@ static void JuniorRCPaintTrackDiag60DegUp( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 36, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 36, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5557,9 +5443,8 @@ static void JuniorRCPaintTrackDiag60DegDown( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 28, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 28, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5580,9 +5465,8 @@ static void JuniorRCPaintTrackDiag25DegUpTo60DegUp( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 16, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 16, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5613,9 +5497,8 @@ static void JuniorRCPaintTrackDiag60DegUpTo25DegUp( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 21, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 21, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5646,9 +5529,8 @@ static void JuniorRCPaintTrackDiag25DegDownTo60DegDown( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 17, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 17, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5669,9 +5551,8 @@ static void JuniorRCPaintTrackDiag60DegDownTo25DegDown( if (trackSequence == 3) { - MetalBSupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, kDiagSupportPlacement[direction], 8, - height, session.SupportColours); + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5757,9 +5638,9 @@ static void JuniorRCFlatTo60DegUpPaintSetup( static constexpr int8_t support[4] = { 12, 12, 12, 14 }; if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, - support[direction], height - 7, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, support[direction], height - 7, + session.SupportColours); } PaintUtilSetSegmentSupportHeight( @@ -5819,9 +5700,8 @@ static void JuniorRC60DegUpToFlatPaintSetup( if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - MetalASupportsPaintSetup( - session, (direction & 1) ? MetalSupportType::ForkAlt : supportType.metal, MetalSupportPlace::Centre, 20, height - 5, - session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 20, height - 5, session.SupportColours); } PaintUtilSetSegmentSupportHeight( diff --git a/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp b/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp index a23423498a..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, MetalSupportType::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, MetalSupportType::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,8 +2377,9 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15353), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 } }); @@ -2387,9 +2388,9 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15361), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 } }); @@ -2478,8 +2479,9 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15353), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, 0, height - 8, session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, direction, 0, height - 8, + session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15365), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); @@ -2488,8 +2490,8 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15361), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 }, @@ -2499,8 +2501,8 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15350), { 16, 0, height }, { { 16, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 }, @@ -2510,8 +2512,8 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15358), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 }, @@ -2662,8 +2664,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15381), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, 0, height - 8, session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, direction, 0, height - 8, + session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15384), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); @@ -2672,8 +2675,8 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15373), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 }, @@ -2683,8 +2686,8 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15378), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 }, @@ -2694,8 +2697,8 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15370), { 16, 0, height }, { { 16, 0, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 }, @@ -2761,9 +2764,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15378), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 } }); @@ -2772,9 +2775,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15370), { 16, 0, height }, { { 16, 0, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 } }); @@ -2783,8 +2786,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15381), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 } }); @@ -2793,9 +2797,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15373), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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 71e2b5d5a9..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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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,31 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3427,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, MetalSupportType::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, MetalSupportType::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); @@ -3546,31 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3616,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, MetalSupportType::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, MetalSupportType::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); @@ -3735,31 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3787,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, MetalSupportType::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, MetalSupportType::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); @@ -3906,31 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4047,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4147,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4246,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4346,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4443,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4544,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4646,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4748,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4850,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4952,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5054,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5156,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5258,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5361,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5461,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5562,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5666,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5768,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5867,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5966,26 +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, MetalSupportType::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, MetalSupportType::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 6b10410a39..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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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,16 @@ 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, MetalSupportType::ForkAlt, MetalSupportPlace::TopRightSide, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 6, height, + session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -2315,8 +1957,9 @@ static void MiniRCTrackSBendLeft( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18905), { 0, 0, height }, { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::TopRightSide, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 6, height, + session.SupportColours); break; } PaintUtilSetSegmentSupportHeight( @@ -2336,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); switch (direction) { case 1: @@ -2397,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, MetalSupportType::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, MetalSupportType::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); @@ -2450,8 +2081,8 @@ static void MiniRCTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18913), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::BottomLeftSide, 6, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 6, height, session.SupportColours); break; case 2: @@ -2495,8 +2126,8 @@ static void MiniRCTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18913), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::BottomLeftSide, 6, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 6, height, session.SupportColours); break; } @@ -2517,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); switch (direction) { case 1: @@ -2578,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, MetalSupportType::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, MetalSupportType::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); @@ -2661,31 +2280,26 @@ static void MiniRCTrackLeftQuarterTurn3( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18819), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -2734,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, MetalSupportType::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, MetalSupportType::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); @@ -2817,15 +2425,11 @@ static void MiniRCTrackLeftQuarterTurn3Bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18831), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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( @@ -2834,17 +2438,16 @@ static void MiniRCTrackLeftQuarterTurn3Bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18841), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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: @@ -2889,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, MetalSupportType::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, MetalSupportType::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); @@ -2937,28 +2534,23 @@ static void MiniRCTrackLeftQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18966), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -2994,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, MetalSupportType::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, MetalSupportType::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); @@ -3042,28 +2628,23 @@ static void MiniRCTrackRightQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18957), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -3121,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, MetalSupportType::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, MetalSupportType::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); @@ -3204,15 +2779,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18989), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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( @@ -3221,17 +2792,16 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18999), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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: @@ -3258,8 +2828,6 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18988), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -3268,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, MetalSupportType::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: @@ -3349,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, MetalSupportType::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( @@ -3373,10 +2932,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18999), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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); @@ -3408,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, MetalSupportType::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( @@ -3432,10 +2986,10 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18985), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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); @@ -3488,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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -3504,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, MetalSupportType::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: @@ -3541,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, MetalSupportType::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( @@ -3565,17 +3114,17 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18985), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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: @@ -3595,6 +3144,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 5: PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; @@ -3633,6 +3183,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; case 7: + { switch (direction) { case 0: @@ -3642,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, MetalSupportType::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, MetalSupportType::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); @@ -3681,6 +3228,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } } } @@ -3730,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, MetalSupportType::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, MetalSupportType::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); @@ -3884,15 +3426,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19027), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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( @@ -3901,17 +3439,16 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19043), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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: @@ -3938,8 +3475,6 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19026), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -3948,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, MetalSupportType::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: @@ -4099,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, MetalSupportType::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( @@ -4123,10 +3649,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19043), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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); @@ -4158,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, MetalSupportType::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( @@ -4182,10 +3703,10 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19021), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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); @@ -4314,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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -4324,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, MetalSupportType::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: @@ -4368,15 +3884,11 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19005), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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( @@ -4385,17 +3897,16 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19021), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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: @@ -4533,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, MetalSupportType::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, MetalSupportType::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); @@ -4724,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, MetalSupportType::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); @@ -4758,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, MetalSupportType::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, MetalSupportType::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); @@ -4818,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, MetalSupportType::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, MetalSupportType::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); @@ -4935,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, MetalSupportType::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, MetalSupportType::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); @@ -5054,31 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5106,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, MetalSupportType::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, MetalSupportType::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); @@ -5225,31 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5295,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, MetalSupportType::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, MetalSupportType::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); @@ -5414,31 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5466,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, MetalSupportType::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, MetalSupportType::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); @@ -5585,31 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5774,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } } @@ -5801,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5903,27 +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, MetalSupportType::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, MetalSupportType::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( @@ -6047,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -6074,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6176,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 22, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 22, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6276,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 27, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 27, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6420,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } } @@ -6447,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6593,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } } @@ -6620,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6722,27 +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, MetalSupportType::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, MetalSupportType::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( @@ -6863,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } } @@ -6890,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6993,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 23, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 23, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7093,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7237,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -7264,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7369,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7471,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7573,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7675,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7777,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7879,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7981,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8084,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8184,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8285,27 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8389,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8491,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8590,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8689,26 +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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8731,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, MetalSupportType::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); @@ -8768,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, MetalSupportType::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, MetalSupportType::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); @@ -8817,30 +7792,25 @@ static void MiniRCTrackLeftBankedQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19316), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -8876,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, MetalSupportType::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, MetalSupportType::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); @@ -8925,30 +7889,25 @@ static void MiniRCTrackRightBankedQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19307), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -9005,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, MetalSupportType::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, MetalSupportType::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); @@ -9157,31 +8110,26 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19290), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -9218,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, MetalSupportType::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, MetalSupportType::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); @@ -9369,31 +8311,26 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19270), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -9447,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( @@ -9460,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, MetalSupportType::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, MetalSupportType::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); @@ -9510,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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -9533,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, MetalSupportType::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); @@ -9573,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( @@ -9586,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, MetalSupportType::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, MetalSupportType::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); @@ -9636,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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -9659,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, MetalSupportType::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); @@ -9733,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, MetalSupportType::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, MetalSupportType::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); @@ -9793,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, MetalSupportType::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, MetalSupportType::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); @@ -9853,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, MetalSupportType::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, MetalSupportType::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); @@ -9913,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, MetalSupportType::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, MetalSupportType::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); @@ -10009,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( @@ -10022,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, MetalSupportType::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, MetalSupportType::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); @@ -10072,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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -10095,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, MetalSupportType::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); @@ -10135,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( @@ -10148,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, MetalSupportType::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, MetalSupportType::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); @@ -10198,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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -10221,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, MetalSupportType::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); @@ -10294,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, MetalSupportType::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, MetalSupportType::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); @@ -10342,28 +9093,23 @@ static void MiniRCTrackLeftCurvedLiftHill( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19332), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -10398,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, MetalSupportType::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, MetalSupportType::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); @@ -10446,28 +9186,23 @@ static void MiniRCTrackRightCurvedLiftHill( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19323), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::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: @@ -10501,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, MetalSupportType::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 a5940c2f25..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, MetalSupportType::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,26 +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, MetalSupportType::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, MetalSupportType::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) @@ -270,26 +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, MetalSupportType::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, MetalSupportType::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) @@ -364,26 +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, MetalSupportType::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, MetalSupportType::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) @@ -457,19 +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, MetalSupportType::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) { @@ -602,19 +526,9 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::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) { @@ -675,19 +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, MetalSupportType::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) { @@ -727,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, MetalSupportType::ForkAlt, MetalSupportPlace::TopRightSide, 0, height + 30, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height + 30, session.SupportColours); break; } @@ -771,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, MetalSupportType::ForkAlt, MetalSupportPlace::TopRightSide, 0, height + 30, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height + 30, session.SupportColours); break; } @@ -812,19 +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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); switch (direction) { @@ -876,19 +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, MetalSupportType::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) { @@ -928,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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height + 30, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height + 30, session.SupportColours); break; } @@ -972,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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height + 30, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height + 30, session.SupportColours); break; } @@ -1013,19 +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, MetalSupportType::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); switch (direction) { @@ -1077,19 +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, MetalSupportType::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) { @@ -1159,19 +1006,9 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::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) { @@ -1236,19 +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, MetalSupportType::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) { @@ -1368,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, MetalSupportType::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, MetalSupportType::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; @@ -1435,19 +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, MetalSupportType::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) { @@ -1567,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, MetalSupportType::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, MetalSupportType::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; @@ -1768,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, MetalSupportType::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, MetalSupportType::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; @@ -1932,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, MetalSupportType::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, MetalSupportType::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; @@ -2096,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, MetalSupportType::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, MetalSupportType::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; @@ -2260,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, MetalSupportType::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, MetalSupportType::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; @@ -2421,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, MetalSupportType::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, MetalSupportType::ForkAlt, MetalSupportPlace::BottomCorner, 0, height + 36, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 36, session.SupportColours); break; } @@ -2585,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, MetalSupportType::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, MetalSupportType::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 701c05a59b..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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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, MetalSupportType::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,9 @@ static void SteeplechaseTrackLeftQuarterTurn5( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28693), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::Centre, 0, height - 1, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height - 1, + session.SupportColours); break; } if (direction == 0 || direction == 3) @@ -510,8 +465,9 @@ static void SteeplechaseTrackLeftQuarterTurn5( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28694), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::Centre, 0, height - 3, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 0, height - 3, + session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -522,8 +478,9 @@ static void SteeplechaseTrackLeftQuarterTurn5( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28704), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::Centre, 1, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 1, height, + session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -571,33 +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, MetalSupportType::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, MetalSupportType::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); @@ -612,6 +566,7 @@ static void SteeplechaseTrackSBendLeft( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 1: switch (direction) { @@ -624,8 +579,8 @@ static void SteeplechaseTrackSBendLeft( case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28671), { 0, 0, height }, { 33, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::TopRightSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height, session.SupportColours); break; case 2: @@ -667,8 +622,8 @@ static void SteeplechaseTrackSBendLeft( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28671), { 0, 0, height }, { 33, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::TopRightSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height, session.SupportColours); break; } @@ -688,28 +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, MetalSupportType::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, MetalSupportType::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: @@ -745,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, MetalSupportType::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, MetalSupportType::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); @@ -793,8 +737,8 @@ static void SteeplechaseTrackSBendRight( case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28675), { 0, 6, height }, { 33, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::BottomLeftSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height, session.SupportColours); break; case 2: @@ -836,8 +780,8 @@ static void SteeplechaseTrackSBendRight( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28675), { 0, 6, height }, { 33, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::BottomLeftSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height, session.SupportColours); break; } @@ -857,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 1: @@ -909,33 +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, MetalSupportType::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, MetalSupportType::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); @@ -950,6 +886,7 @@ static void SteeplechaseTrackLeftQuarterTurn3( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 1: PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; @@ -984,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, MetalSupportType::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, MetalSupportType::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: @@ -1030,6 +966,7 @@ static void SteeplechaseTrackLeftQuarterTurn3( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } } } @@ -1053,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, MetalSupportType::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); @@ -1082,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, MetalSupportType::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, MetalSupportType::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); @@ -1201,31 +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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1253,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, MetalSupportType::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, MetalSupportType::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); @@ -1372,32 +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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1571,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -1598,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1744,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } @@ -1771,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1917,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } @@ -1944,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2090,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -2117,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2260,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } @@ -2287,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2434,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } @@ -2461,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, MetalSupportType::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, MetalSupportType::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2508,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, MetalSupportType::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/TwisterRollerCoaster.cpp b/src/openrct2/paint/track/coaster/TwisterRollerCoaster.cpp index 7bce52eacd..f8c880ee1a 100644 --- a/src/openrct2/paint/track/coaster/TwisterRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/TwisterRollerCoaster.cpp @@ -24,6 +24,7 @@ #include "../../track/Support.h" using namespace OpenRCT2; + static constexpr uint32_t BM_BLOCK_BRAKE_SW_NE_OPEN = 17150; static constexpr uint32_t BM_BLOCK_BRAKE_NW_SE_OPEN = 17151; static constexpr uint32_t BM_BLOCK_BRAKE_SW_NE_CLOSED = 17152; diff --git a/src/openrct2/paint/track/gentle/MonorailCycles.cpp b/src/openrct2/paint/track/gentle/MonorailCycles.cpp index 54773209df..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, MetalSupportType::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::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,22 +567,22 @@ static void PaintMonorailCyclesTrackSBendRight( { PaintUtilPushTunnelRight(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportType::StickAlt, MetalSupportPlace::BottomLeftSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::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 f7bb4d6fd7..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, MetalSupportType::Tubes, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::BottomLeftSide, 0, height, session.SupportColours); - } - else - { - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::TopLeftSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportType::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 fb25813b0f..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, MetalSupportType::Tubes, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::BottomLeftSide, 0, height, session.SupportColours); - } - else - { - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::TopLeftSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportType::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 f2c1d8e1fb..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, MetalSupportType::Tubes, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportType::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, MetalSupportType::Tubes, MetalSupportPlace::TopLeftSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportType::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 9357cb4957..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, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction != 2) { PaintUtilSetSegmentSupportHeight(