1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Workaround for OpenGL renderer viewport panning, turn it into a hybrid

This commit is contained in:
ζeh Matt
2025-04-06 18:43:45 +03:00
parent 911f821245
commit c9bba5ee63
2 changed files with 14 additions and 1 deletions

View File

@@ -343,6 +343,11 @@ public:
void PaintWindows() override
{
WindowResetVisibilities();
// Redraw dirty regions before updating the viewports, otherwise
// when viewports get panned, they copy dirty pixels
DrawAllDirtyBlocks();
WindowUpdateAllViewports();
DrawAllDirtyBlocks();
}
@@ -435,7 +440,7 @@ public:
DrawingEngineFlags GetFlags() override
{
return DrawingEngineFlag::dirtyOptimisations;
return {};
}
void InvalidateImage(uint32_t image) override

View File

@@ -526,6 +526,10 @@ namespace OpenRCT2
WindowDrawAll(dpi, left, top, right, bottom);
return;
}
else
{
GfxInvalidateScreen();
}
}
Viewport view_copy = *viewport;
@@ -573,6 +577,10 @@ namespace OpenRCT2
DrawPixelInfo& dpi = DrawingEngineGetDpi();
ViewportShiftPixels(dpi, w, viewport, x_diff, y_diff);
}
else
{
GfxInvalidateScreen();
}
*viewport = view_copy;
}