diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 61be6af371..863ea4df1e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.20 (in development) ------------------------------------------------------------------------ - Improved: [#23677] Building new ride track now inherits the colour scheme from the previous piece. +- Fix: [#21768] Dirty blocks debug overlay is rendered incorrectly on high DPI screens. - Fix: [#22617] Sloped Wooden and Side-Friction supports draw out of order when built directly above diagonal track pieces. - Fix: [#23522] Diagonal sloped Steeplechase supports have glitched sprites at the base. - Fix: [#23795] Looping Roller Coaster vertical loop supports are drawn incorrectly. diff --git a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp index d5ba5cfb5b..a7f6fa383a 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -365,8 +365,12 @@ private: void RenderDirtyVisuals() { - float scaleX = Config::Get().general.WindowScale; - float scaleY = Config::Get().general.WindowScale; + int windowX, windowY, renderX, renderY; + SDL_GetWindowSize(_window, &windowX, &windowY); + SDL_GetRendererOutputSize(_sdlRenderer, &renderX, &renderY); + + float scaleX = Config::Get().general.WindowScale * renderX / static_cast(windowX); + float scaleY = Config::Get().general.WindowScale * renderY / static_cast(windowY); SDL_SetRenderDrawBlendMode(_sdlRenderer, SDL_BLENDMODE_BLEND); for (uint32_t y = 0; y < _dirtyGrid.BlockRows; y++) @@ -377,7 +381,6 @@ private: if (timeLeft > 0) { uint8_t alpha = static_cast(timeLeft * 5 / 2); - SDL_Rect ddRect; ddRect.x = static_cast(x * _dirtyGrid.BlockWidth * scaleX); ddRect.y = static_cast(y * _dirtyGrid.BlockHeight * scaleY);