Fix #26288: Land bordering map edges does not blend at certain angles (#26844)

The current surface tiles position was being set to session.SpritePosition, which changed depending on the camera angle, rather than session.MapPosition. Depending on the camera angle, this puts the current tile position out of bounds at the edges of the map, skipping the blend.

This fixes that, and then adjusts the neighbouring tile coordinates so that they work for the correct starting position. These now make a lot more sense, the previous coordinates were quite strange in order to compensate for the original offset position.

This also renames that array of coordinates to a better name. As far as I know this array doesn't already exist elsewhere.

The current surfaces position is only being used to check when blending, so this should not affect anything else.

I've checked by diffing giant screenshots of a couple of parks at all rotations and found no other differences, but this could probably do with a double check.
This commit is contained in:
mix authored and GitHub committed 2026-08-02 07:46:54 +00:00
1 parent d181e640ac
commit a4f0d22988
2 files changed
+15 -14

No files matched your search

+1
View File
@@ -6,6 +6,7 @@
- Improved: [#26763] The ride colour/appearance tab now visually separates fields using group boxes.
- Improved: [#26765] The ride operations tab now visually separates fields using group boxes.
- Improved: [#26839] Magnify picked-up peeps when viewport is in double or quadruple zoom.
- Fix: [#26288] Land bordering map edges does not blend at certain angles.
- Fix: [#26610] Player list is not updated automatically when a player joins or leaves.
- Fix: [#26639] Handymen could begin a task while another handyman was already doing the exact same task.
- Fix: [#26752] The Cut-away View window doesn’t display negative height values correctly on some platforms.
@@ -50,30 +50,30 @@ static constexpr uint8_t Byte97B444[] = {
};
// rct2: 0x97B464, 0x97B474, 0x97B484, 0x97B494
static constexpr CoordsXY viewport_surface_paint_data[][4] = {
static constexpr CoordsXY kNeighbouringTileCoordOffsets[4][kNumOrthogonalDirections] = {
{
{ 32, 0 },
{ -32, 32 },
{ -64, -32 },
{ 0, -64 },
{ 0, 32 },
{ -32, 0 },
{ 0, -32 },
},
{
{ 0, 32 },
{ -64, 0 },
{ -32, -64 },
{ 32, -32 },
{ -32, 0 },
{ 0, -32 },
{ 32, 0 },
},
{
{ 0, -32 },
{ 0, 0 },
{ 32, 0 },
{ 0, 32 },
{ -32, 0 },
{ -32, -32 },
},
{
{ -32, 0 },
{ -32, -32 },
{ 0, -32 },
{ 0, 0 },
{ 32, 0 },
{ 0, 32 },
},
};
@@ -937,7 +937,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con
const auto zoomLevel = session.rt.zoom_level;
const uint8_t rotation = session.CurrentRotation;
const uint8_t surfaceShape = ViewportSurfacePaintSetupGetRelativeSlope(tileElement, rotation);
const CoordsXY& base = session.SpritePosition;
const CoordsXY& base = session.MapPosition;
const auto cornerHeights = GetSlopeRelativeCornerHeights(surfaceShape);
const TileElement* elementPtr = &reinterpret_cast<const TileElement&>(tileElement);
@@ -959,9 +959,9 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con
TileDescriptor tileDescriptors[4];
for (std::size_t i = 0; i < std::size(viewport_surface_paint_data); i++)
for (std::size_t i = 0; i < std::size(kNeighbouringTileCoordOffsets); i++)
{
const CoordsXY& offset = viewport_surface_paint_data[i][rotation];
const CoordsXY& offset = kNeighbouringTileCoordOffsets[i][rotation];
const CoordsXY position = base + offset;
TileDescriptor& descriptor = tileDescriptors[i];