From 4ee088e27d3950dce077344e3095b99c09640733 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 19 Oct 2023 00:03:49 +0200 Subject: [PATCH] Also include the thick supports in RotatedMetalSupports --- src/openrct2/paint/Supports.cpp | 30 ++++++++++++++++-------------- src/openrct2/paint/Supports.h | 6 +----- src/openrct2/ride/TrackPaint.cpp | 4 ++-- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 5ee320a0be..8f56f23a4a 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -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 }, }; diff --git a/src/openrct2/paint/Supports.h b/src/openrct2/paint/Supports.h index 8cf7c7d897..ab9af53cbf 100644 --- a/src/openrct2/paint/Supports.h +++ b/src/openrct2/paint/Supports.h @@ -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. diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 1e11c3ffcc..558f840314 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -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); }