From 3ce917e2e14936c45ea6ad458cccf69147b4b330 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 13 Apr 2024 20:32:55 +0100 Subject: [PATCH] Fix #6725: Z-fighting when car passes through scenery door --- distribution/changelog.txt | 1 + src/openrct2/paint/tile_element/Paint.Wall.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index fd440ac742..f1771e3fb3 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -24,6 +24,7 @@ - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Change: [#21545] Reorder Wacky Worlds scenarios and adjust their difficulty classification. - Fix: [#910] Extra viewport does not preserve the location when rotating. +- Fix: [#6725] Z fighting issue with cars using animated doors. - Fix: [#18413] Crash when mouse over a hacked train. - Fix: [#20338] Cannot select Scenery Picker or Scatter Tool when the scenery recolouring tool is active. - Fix: [#21317] Track designer allows proceeding without an object selected. diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index aac97ceb64..a6cd5ef823 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -58,7 +58,7 @@ static void PaintWallDoor( auto newImageId0 = imageId; auto newImageId1 = imageId.WithIndexOffset(1); - if (wallEntry.flags & WALL_SCENERY_IS_DOUBLE_SIDED) + if (wallEntry.flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE) { PaintAddImageAsParent(session, newImageId0, offset, bbR1); PaintAddImageAsParent(session, newImageId1, offset, bbR2); @@ -89,7 +89,7 @@ static void PaintWallDoor( case 0: { BoundBoxXYZ bbR1 = { { 1, 1, height + 1 }, { 1, 3, bbHeight - 5 } }; - BoundBoxXYZ bbR2 = { { 1, 1, height + bbHeight - 9 }, { 1, 28, 3 } }; + BoundBoxXYZ bbR2 = { { 1, 1, height + bbHeight - 4 }, { 1, 28, 3 } }; BoundBoxXYZ bbL = { { 1, 1, height + 1 }, { 1, 28, bbHeight } }; @@ -101,7 +101,7 @@ static void PaintWallDoor( case 1: { BoundBoxXYZ bbR1 = { { 1, 30, height + 1 }, { 3, 3, bbHeight - 5 } }; - BoundBoxXYZ bbR2 = { { 1, 30, height + bbHeight - 8 }, { 29, 3, 2 } }; + BoundBoxXYZ bbR2 = { { 1, 30, height + bbHeight - 3 }, { 29, 3, 2 } }; BoundBoxXYZ bbL = { { 2, 30, height + 1 }, { 29, 1, bbHeight } }; CoordsXYZ offset = { 1, 31, height }; @@ -112,7 +112,7 @@ static void PaintWallDoor( case 2: { BoundBoxXYZ bbR1 = { { 30, 1, height + 1 }, { 3, 3, bbHeight - 5 } }; - BoundBoxXYZ bbR2 = { { 30, 1, height + bbHeight - 8 }, { 3, 29, 2 } }; + BoundBoxXYZ bbR2 = { { 30, 1, height + bbHeight - 3 }, { 3, 29, 2 } }; BoundBoxXYZ bbL = { { 30, 2, height + 1 }, { 1, 29, bbHeight } }; CoordsXYZ offset = { 31, 0, height }; @@ -123,7 +123,7 @@ static void PaintWallDoor( case 3: { BoundBoxXYZ bbR1 = { { 1, 1, height + 1 }, { 3, 1, bbHeight - 5 } }; - BoundBoxXYZ bbR2 = { { 1, 1, height + bbHeight - 9 }, { 28, 1, 3 } }; + BoundBoxXYZ bbR2 = { { 1, 1, height + bbHeight - 4 }, { 28, 1, 3 } }; BoundBoxXYZ bbL = { { 1, 1, height + 1 }, { 28, 1, bbHeight } }; CoordsXYZ offset = { 2, 1, height };