From 7d885714023a5aa126328d705873acf71c4544f2 Mon Sep 17 00:00:00 2001 From: mix Date: Tue, 12 Aug 2025 21:30:04 +0100 Subject: [PATCH 1/6] Ignore corner connections when painting queues --- src/openrct2/paint/tile_element/Paint.Path.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index a3dfcda279..88d93a3a7b 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -958,9 +958,9 @@ void PathPaintBoxSupport( PROFILED_FUNCTION(); auto [edges, corners] = PathPaintGetRotatedEdgesAndCorners(session, pathElement); - uint16_t edi = edges | (corners << 4); + const uint8_t edgesAndCorners = pathElement.IsQueue() ? edges : edges | (corners << 4); - auto surfaceBaseImageIndex = PathPaintGetBaseImage(session, pathElement, pathPaintInfo, edi); + const auto surfaceBaseImageIndex = PathPaintGetBaseImage(session, pathElement, pathPaintInfo, edgesAndCorners); auto boundbox = PathPaintGetBoundbox(session, height, edges); const bool hasPassedSurface = (session.Flags & PaintSessionFlags::PassedSurface) != 0; @@ -990,7 +990,7 @@ void PathPaintBoxSupport( } } - Sub6A3F61(session, pathElement, edi, height, pathPaintInfo, imageTemplate, sceneryImageTemplate, hasSupports); + Sub6A3F61(session, pathElement, edgesAndCorners, height, pathPaintInfo, imageTemplate, sceneryImageTemplate, hasSupports); Direction slopeDirection{}; if (pathElement.IsSloped()) @@ -1011,9 +1011,9 @@ void PathPaintPoleSupport( PROFILED_FUNCTION(); auto [edges, corners] = PathPaintGetRotatedEdgesAndCorners(session, pathElement); - uint16_t edi = edges | (corners << 4); + const uint8_t edgesAndCorners = pathElement.IsQueue() ? edges : edges | (corners << 4); - auto surfaceBaseImageIndex = PathPaintGetBaseImage(session, pathElement, pathPaintInfo, edi); + const auto surfaceBaseImageIndex = PathPaintGetBaseImage(session, pathElement, pathPaintInfo, edgesAndCorners); auto boundbox = PathPaintGetBoundbox(session, height, edges); // Below Surface @@ -1045,7 +1045,7 @@ void PathPaintPoleSupport( } Sub6A3F61( - session, pathElement, edi, height, pathPaintInfo, imageTemplate, sceneryImageTemplate, + session, pathElement, edgesAndCorners, height, pathPaintInfo, imageTemplate, sceneryImageTemplate, hasSupports); // TODO: arguments MetalSupportPlace supports[] = { From 6e5532ebebc2f130bcd9ec46de52cf4e926af95e Mon Sep 17 00:00:00 2001 From: mix Date: Tue, 12 Aug 2025 21:31:31 +0100 Subject: [PATCH 2/6] Rename Byte98D6E0 to kPathEdgesAndCornersToSurfaceImageIndexOffset --- src/openrct2/paint/tile_element/Paint.Path.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 88d93a3a7b..e6ea2ae366 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -57,7 +57,7 @@ const uint8_t kPathSlopeToLandSlope[] = { kTileSlopeSESideUp, }; -static constexpr uint8_t Byte98D6E0[] = { +static constexpr uint8_t kPathEdgesAndCornersToSurfaceImageIndexOffset[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 20, 4, 5, 6, 22, 8, 9, 10, 26, 12, 13, 14, 36, 0, 1, 2, 3, 4, 5, 21, 23, 8, 9, 10, 11, 12, 13, 33, 37, 0, 1, 2, 3, 4, 5, 6, 24, 8, 9, 10, 11, 12, 13, 14, 38, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 29, 30, 34, 39, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 40, @@ -870,7 +870,7 @@ static ImageIndex PathPaintGetBaseImage( } else { - surfaceBaseImageIndex += Byte98D6E0[rotatedEdgesAndCorners]; + surfaceBaseImageIndex += kPathEdgesAndCornersToSurfaceImageIndexOffset[rotatedEdgesAndCorners]; } return surfaceBaseImageIndex; From fab6c70b2ce52777115888150a1b13e2234a8a42 Mon Sep 17 00:00:00 2001 From: mix Date: Tue, 12 Aug 2025 21:33:45 +0100 Subject: [PATCH 3/6] Rename stru_98D804 to kPathBoundingBoxes in path paint --- src/openrct2/paint/tile_element/Paint.Path.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index e6ea2ae366..9d755cbe15 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -69,7 +69,7 @@ static constexpr uint8_t kPathEdgesAndCornersToSurfaceImageIndexOffset[] = { }; // clang-format off -static constexpr BoundBoxXY stru_98D804[] = { +static constexpr BoundBoxXY kPathBoundingBoxes[] = { { { 3, 3 }, { 26, 26 } }, { { 0, 3 }, { 29, 26 } }, { { 3, 3 }, { 26, 29 } }, @@ -878,8 +878,8 @@ static ImageIndex PathPaintGetBaseImage( static BoundBoxXYZ PathPaintGetBoundbox(const PaintSession& session, int32_t height, uint8_t edges) { - CoordsXY boundBoxOffset = stru_98D804[edges].offset; - CoordsXY boundBoxSize = stru_98D804[edges].length; + CoordsXY boundBoxOffset = kPathBoundingBoxes[edges].offset; + CoordsXY boundBoxSize = kPathBoundingBoxes[edges].length; const bool hasPassedSurface = (session.Flags & PaintSessionFlags::PassedSurface) != 0; if (!hasPassedSurface) From 4a5f8020211a284022d7b745bc0e25364ee249d6 Mon Sep 17 00:00:00 2001 From: mix Date: Tue, 12 Aug 2025 21:38:22 +0100 Subject: [PATCH 4/6] Rename Sub6A3F61 to PathPaintFencesAdditionsTunnels --- src/openrct2/paint/tile_element/Paint.Path.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 9d755cbe15..867e44662f 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -598,7 +598,7 @@ static void PathPaintFencesAndQueueBanners( * @param imageFlags (0x00F3EF70) * @param sceneryImageFlags (0x00F3EF74) */ -static void Sub6A3F61( +static void PathPaintFencesAdditionsTunnels( PaintSession& session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, const FootpathPaintInfo& pathPaintInfo, ImageId imageTemplate, ImageId sceneryImageTemplate, bool hasSupports) { @@ -990,7 +990,8 @@ void PathPaintBoxSupport( } } - Sub6A3F61(session, pathElement, edgesAndCorners, height, pathPaintInfo, imageTemplate, sceneryImageTemplate, hasSupports); + PathPaintFencesAdditionsTunnels( + session, pathElement, edgesAndCorners, height, pathPaintInfo, imageTemplate, sceneryImageTemplate, hasSupports); Direction slopeDirection{}; if (pathElement.IsSloped()) @@ -1044,7 +1045,7 @@ void PathPaintPoleSupport( } } - Sub6A3F61( + PathPaintFencesAdditionsTunnels( session, pathElement, edgesAndCorners, height, pathPaintInfo, imageTemplate, sceneryImageTemplate, hasSupports); // TODO: arguments From 8d76071f22c48ece4877420455f97e4aa93b724d Mon Sep 17 00:00:00 2001 From: mix Date: Tue, 12 Aug 2025 21:56:14 +0100 Subject: [PATCH 5/6] Change PathPaintGetBaseImage rotatedEdgesAndCorners arg to uint8_t --- src/openrct2/paint/tile_element/Paint.Path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 867e44662f..be6154c482 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -859,7 +859,7 @@ static std::pair PathPaintGetRotatedEdgesAndCorners( static ImageIndex PathPaintGetBaseImage( const PaintSession& session, const PathElement& pathElement, const FootpathPaintInfo& pathPaintInfo, - uint16_t rotatedEdgesAndCorners) + const uint8_t rotatedEdgesAndCorners) { ImageIndex surfaceBaseImageIndex = pathPaintInfo.SurfaceImageId; if (pathElement.IsSloped()) From 29386c3d4fb62012165d6140e61019953e724590 Mon Sep 17 00:00:00 2001 From: mix Date: Wed, 13 Aug 2025 15:00:40 +0100 Subject: [PATCH 6/6] Add changelog entry for corner connected queue incorrect sprites --- distribution/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 3cc44b8e31..ba719a7f3b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -11,6 +11,7 @@ - Fix: [#24915] LIM Launched (original bug), Corkscrew and Twister Roller Coaster inline twists have some incorrect tunnels. - Fix: [#24953] Crash when opening the Scenario Editor, Track Designer or Track Designs Manager. - Fix: [#24958] Android: fix crash when device is offline. +- Fix: [#24961] Queues with corner connections set with the tile inspector draw incorrect sprites. 0.4.25 (2025-08-03) ------------------------------------------------------------------------