diff --git a/src/openrct2/paint/support/MetalSupports.cpp b/src/openrct2/paint/support/MetalSupports.cpp index b9b15ab2c6..08f266f67e 100644 --- a/src/openrct2/paint/support/MetalSupports.cpp +++ b/src/openrct2/paint/support/MetalSupports.cpp @@ -178,6 +178,26 @@ static constexpr uint8_t metal_supports_slope_image_map[] = { }; // clang-format on +static constexpr MetalSupportPlace kMetalSupportPlacementRotated[][NumOrthogonalDirections] = { + { MetalSupportPlace::TopCorner, MetalSupportPlace::RightCorner, MetalSupportPlace::BottomCorner, + MetalSupportPlace::LeftCorner }, + { MetalSupportPlace::LeftCorner, MetalSupportPlace::TopCorner, MetalSupportPlace::RightCorner, + MetalSupportPlace::BottomCorner }, + { MetalSupportPlace::RightCorner, MetalSupportPlace::BottomCorner, MetalSupportPlace::LeftCorner, + MetalSupportPlace::TopCorner }, + { MetalSupportPlace::BottomCorner, MetalSupportPlace::LeftCorner, MetalSupportPlace::TopCorner, + MetalSupportPlace::RightCorner }, + { MetalSupportPlace::Centre, MetalSupportPlace::Centre, MetalSupportPlace::Centre, MetalSupportPlace::Centre }, + { MetalSupportPlace::TopLeftSide, MetalSupportPlace::TopRightSide, MetalSupportPlace::BottomRightSide, + MetalSupportPlace::BottomLeftSide }, + { MetalSupportPlace::TopRightSide, MetalSupportPlace::BottomRightSide, MetalSupportPlace::BottomLeftSide, + MetalSupportPlace::TopLeftSide }, + { MetalSupportPlace::BottomLeftSide, MetalSupportPlace::BottomLeftSide, MetalSupportPlace::TopLeftSide, + MetalSupportPlace::TopRightSide }, + { MetalSupportPlace::BottomRightSide, MetalSupportPlace::TopLeftSide, MetalSupportPlace::TopRightSide, + MetalSupportPlace::BottomRightSide }, +}; + /** * Metal pole supports * @param supportType (edi) @@ -374,6 +394,14 @@ bool MetalASupportsPaintSetup( return true; } +bool MetalASupportsPaintSetupRotated( + PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, + int32_t special, int32_t height, ImageId imageTemplate) +{ + placement = kMetalSupportPlacementRotated[EnumValue(placement)][direction]; + return MetalASupportsPaintSetup(session, supportTypeMember, placement, special, height, imageTemplate); +} + /** * Metal pole supports * rct2: 0x00663584 @@ -559,6 +587,14 @@ bool MetalBSupportsPaintSetup( return false; // AND } +bool MetalBSupportsPaintSetupRotated( + PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, + int32_t special, int32_t height, ImageId imageTemplate) +{ + placement = kMetalSupportPlacementRotated[EnumValue(placement)][direction]; + return MetalBSupportsPaintSetup(session, supportTypeMember, placement, special, height, imageTemplate); +} + constexpr uint8_t MetalSupportTypeCount = 13; constexpr MetalSupportType RotatedMetalSupports[MetalSupportTypeCount][NumOrthogonalDirections] = { { MetalSupportType::Tubes, MetalSupportType::Tubes, MetalSupportType::Tubes, MetalSupportType::Tubes }, diff --git a/src/openrct2/paint/support/MetalSupports.h b/src/openrct2/paint/support/MetalSupports.h index 40c74e4288..c1e3b95db1 100644 --- a/src/openrct2/paint/support/MetalSupports.h +++ b/src/openrct2/paint/support/MetalSupports.h @@ -95,9 +95,15 @@ struct PaintSession; bool MetalASupportsPaintSetup( PaintSession& session, MetalSupportType supportTypeMember, 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); bool MetalBSupportsPaintSetup( PaintSession& session, MetalSupportType supportTypeMember, 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); void DrawSupportsSideBySide( PaintSession& session, Direction direction, uint16_t height, ImageId colour, MetalSupportType type, int32_t special = 0); bool PathPoleSupportsPaintSetup(