From e2d9a44a5dfd84e89bce210d4be230f794563124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 25 Apr 2025 17:46:30 +0300 Subject: [PATCH] Fix stray pixels showing up when panning and moving a windows --- .../drawing/engines/opengl/OpenGLDrawingEngine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 73ea92a35e..48c99a424d 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -361,16 +361,20 @@ public: void PaintWindows() override { WindowResetVisibilities(); - WindowUpdateAllViewports(); if (ClimateIsRaining() || ClimateIsSnowing() || ClimateIsSnowingHeavily()) { + WindowUpdateAllViewports(); // OpenGL doesn't support restoring pixels, always redraw. // TODO: Render the weather to a texture and use that instead. WindowDrawAll(_bitsDPI, 0, 0, static_cast(_width), static_cast(_height)); } else { + // Redraw dirty regions before updating the viewports, otherwise + // when viewports get panned, they copy dirty pixels + DrawAllDirtyBlocks(); + WindowUpdateAllViewports(); DrawAllDirtyBlocks(); } }