1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 08:45:00 +01:00

Fix land edges glitch when vehicles go through gentle to flat tunnels

This commit is contained in:
mix
2025-02-18 20:34:43 +00:00
committed by GitHub
parent a595e4a496
commit d946ab3374
2 changed files with 28 additions and 24 deletions

View File

@@ -12,6 +12,7 @@
- Fix: [#23522] Diagonal sloped Steeplechase supports have glitched sprites at the base.
- Fix: [#23795] Looping Roller Coaster vertical loop supports are drawn incorrectly.
- Fix: [#23809] Trains glitch on Bobsleigh Coaster small helixes.
- Fix: [#23811] Land edges glitch when vehicles go through gentle to flat tunnels.
- Fix: [#23818] Spinning tunnels can draw over sloped terrain in front of them.
0.4.19.1 (2025-02-03)

View File

@@ -161,33 +161,34 @@ struct TunnelDescriptor
uint8_t height;
uint8_t boundBoxLength;
int16_t boundBoxZOffset;
int8_t lowerEdgeBoundingBoxZ;
TunnelType lowClearanceAlternative;
uint8_t imageOffset;
};
static constexpr TunnelDescriptor kTunnels[] = {
{ 2, 2, 0, TunnelType::StandardFlat, 36 }, // TunnelType::StandardFlat
{ 3, 3, 0, TunnelType::StandardFlat, 40 }, // TunnelType::StandardSlopeStart
{ 3, 5, -32, TunnelType::StandardFlat, 44 }, // TunnelType::StandardSlopeEnd
{ 3, 3, 0, TunnelType::InvertedFlat, 48 }, // TunnelType::InvertedFlat
{ 4, 4, 0, TunnelType::InvertedFlat, 52 }, // TunnelType::InvertedSlopeStart
{ 4, 6, -48, TunnelType::InvertedFlat, 56 }, // TunnelType::InvertedSlopeEnd
{ 2, 2, 0, TunnelType::SquareFlat, 60 }, // TunnelType::SquareFlat
{ 3, 3, 0, TunnelType::SquareFlat, 64 }, // TunnelType::SquareSlopeStart
{ 3, 5, -32, TunnelType::SquareFlat, 68 }, // TunnelType::SquareSlopeEnd
{ 3, 3, 0, TunnelType::SquareFlat, 72 }, // TunnelType::InvertedSquare
{ 2, 3, -16, TunnelType::PathAndMiniGolf, 76 }, // TunnelType::PathAndMiniGolf
{ 2, 3, -16, TunnelType::Path11, 80 }, // TunnelType::Path11
{ 2, 3, -16, TunnelType::StandardFlatTo25Deg, 36 }, // TunnelType::StandardFlatTo25Deg
{ 3, 4, -16, TunnelType::InvertedFlatTo25Deg, 48 }, // TunnelType::InvertedFlatTo25Deg
{ 2, 3, -16, TunnelType::SquareFlatTo25Deg, 60 }, // TunnelType::SquareFlatTo25Deg
{ 3, 4, -16, TunnelType::SquareFlatTo25Deg, 72 }, // TunnelType::InvertedSquareFlatTo25Deg
{ 2, 2, 0, TunnelType::Doors0, 76 }, // TunnelType::Doors0
{ 2, 2, 0, TunnelType::Doors1, 80 }, // TunnelType::Doors1
{ 2, 2, 0, TunnelType::Doors2, 84 }, // TunnelType::Doors2
{ 2, 2, 0, TunnelType::Doors3, 88 }, // TunnelType::Doors3
{ 2, 2, 0, TunnelType::Doors4, 92 }, // TunnelType::Doors4
{ 2, 2, 0, TunnelType::Doors5, 96 }, // TunnelType::Doors5
{ 2, 2, 0, TunnelType::Doors6, 100 }, // TunnelType::Doors6
{ 2, 2, 0, 15, TunnelType::StandardFlat, 36 }, // TunnelType::StandardFlat
{ 3, 3, 0, 15, TunnelType::StandardFlat, 40 }, // TunnelType::StandardSlopeStart
{ 3, 5, -32, 4, TunnelType::StandardFlat, 44 }, // TunnelType::StandardSlopeEnd
{ 3, 3, 0, 15, TunnelType::InvertedFlat, 48 }, // TunnelType::InvertedFlat
{ 4, 4, 0, 15, TunnelType::InvertedFlat, 52 }, // TunnelType::InvertedSlopeStart
{ 4, 6, -48, 4, TunnelType::InvertedFlat, 56 }, // TunnelType::InvertedSlopeEnd
{ 2, 2, 0, 15, TunnelType::SquareFlat, 60 }, // TunnelType::SquareFlat
{ 3, 3, 0, 15, TunnelType::SquareFlat, 64 }, // TunnelType::SquareSlopeStart
{ 3, 5, -32, 4, TunnelType::SquareFlat, 68 }, // TunnelType::SquareSlopeEnd
{ 3, 3, 0, 15, TunnelType::SquareFlat, 72 }, // TunnelType::InvertedSquare
{ 2, 3, -16, 15, TunnelType::PathAndMiniGolf, 76 }, // TunnelType::PathAndMiniGolf
{ 2, 3, -16, 15, TunnelType::Path11, 80 }, // TunnelType::Path11
{ 2, 3, -16, 4, TunnelType::StandardFlatTo25Deg, 36 }, // TunnelType::StandardFlatTo25Deg
{ 3, 4, -16, 4, TunnelType::InvertedFlatTo25Deg, 48 }, // TunnelType::InvertedFlatTo25Deg
{ 2, 3, -16, 4, TunnelType::SquareFlatTo25Deg, 60 }, // TunnelType::SquareFlatTo25Deg
{ 3, 4, -16, 4, TunnelType::SquareFlatTo25Deg, 72 }, // TunnelType::InvertedSquareFlatTo25Deg
{ 2, 2, 0, 15, TunnelType::Doors0, 76 }, // TunnelType::Doors0
{ 2, 2, 0, 15, TunnelType::Doors1, 80 }, // TunnelType::Doors1
{ 2, 2, 0, 15, TunnelType::Doors2, 84 }, // TunnelType::Doors2
{ 2, 2, 0, 15, TunnelType::Doors3, 88 }, // TunnelType::Doors3
{ 2, 2, 0, 15, TunnelType::Doors4, 92 }, // TunnelType::Doors4
{ 2, 2, 0, 15, TunnelType::Doors5, 96 }, // TunnelType::Doors5
{ 2, 2, 0, 15, TunnelType::Doors6, 100 }, // TunnelType::Doors6
};
// clang-format on
@@ -638,7 +639,9 @@ static void ViewportSurfaceDrawTileSideBottom(
if (isWater || curHeight != tunnelArray[tunnelIndex].height)
{
PaintAddImageAsParent(session, baseImageId, { offset, curHeight * kCoordsZPerTinyZ }, { bounds, 15 });
const auto td = kTunnels[EnumValue(tunnelArray[tunnelIndex].type)];
const auto boundBoxZ = curHeight == tunnelArray[tunnelIndex].height - 1 ? td.lowerEdgeBoundingBoxZ : 15;
PaintAddImageAsParent(session, baseImageId, { offset, curHeight * kCoordsZPerTinyZ }, { bounds, boundBoxZ });
curHeight++;
continue;