Also include the thick supports in RotatedMetalSupports

This commit is contained in:
Gymnasiast 2023-10-19 00:03:49 +02:00
parent 7cf75ab11d
commit 4ee088e27d
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
3 changed files with 19 additions and 21 deletions

View File

@ -1540,18 +1540,20 @@ bool PathBSupportsPaintSetup(
return false; // AND
}
MetalSupportType RotatedMetalSupports[MetalSupportTypeCount][2] = {
{ MetalSupportType::Tubes, MetalSupportType::Tubes },
{ MetalSupportType::Fork, MetalSupportType::ForkAlt },
{ MetalSupportType::ForkAlt, MetalSupportType::Fork },
{ MetalSupportType::Boxed, MetalSupportType::Boxed },
{ MetalSupportType::Stick, MetalSupportType::StickAlt },
{ MetalSupportType::StickAlt, MetalSupportType::Stick },
{ MetalSupportType::ThickCentred, MetalSupportType::ThickAltCentred },
{ MetalSupportType::Thick, MetalSupportType::ThickAlt },
{ MetalSupportType::ThickAlt, MetalSupportType::Thick },
{ MetalSupportType::ThickAltCentred, MetalSupportType::ThickCentred },
{ MetalSupportType::Truss, MetalSupportType::Truss },
{ MetalSupportType::TubesInverted, MetalSupportType::TubesInverted },
{ MetalSupportType::BoxedCoated, MetalSupportType::BoxedCoated },
MetalSupportType RotatedMetalSupports[MetalSupportTypeCount][NumOrthogonalDirections] = {
{ 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 },
};

View File

@ -95,11 +95,7 @@ enum class MetalSupportType : uint8_t
};
constexpr uint8_t MetalSupportTypeCount = 13;
/**
* Each pair corresponds with a type of metal support. The first entry is for even rotations (0 and 2),
* the second entry is for odd rotations (1 and 3).
*/
extern MetalSupportType RotatedMetalSupports[MetalSupportTypeCount][2];
extern MetalSupportType RotatedMetalSupports[MetalSupportTypeCount][NumOrthogonalDirections];
/**
* Tiles are rendered at a 45 degree angle, with the corners on the top, bottom, left and right.

View File

@ -951,10 +951,10 @@ void TrackPaintUtilDrawStationMetalSupports(PaintSession& session, Direction dir
void TrackPaintUtilDrawStationMetalSupports2(
PaintSession& session, Direction direction, uint16_t height, ImageId colour, MetalSupportType type, int32_t special)
{
type = RotatedMetalSupports[EnumValue(type)][direction];
if (direction & 1)
{
type = RotatedMetalSupports[EnumValue(type)][1];
MetalASupportsPaintSetup(session, type, MetalSupportPlace::TopRightSide, special, height, colour);
MetalASupportsPaintSetup(session, type, MetalSupportPlace::BottomLeftSide, special, height, colour);
}