1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 16:54:52 +01:00

Fix debug dirty visuals scaling on high DPI displays (#23697)

This commit is contained in:
Alex ZH
2025-02-10 14:42:39 -05:00
committed by GitHub
parent 5a3ebb65de
commit a8aa41f098
2 changed files with 7 additions and 3 deletions

View File

@@ -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.

View File

@@ -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<float>(windowX);
float scaleY = Config::Get().general.WindowScale * renderY / static_cast<float>(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<uint8_t>(timeLeft * 5 / 2);
SDL_Rect ddRect;
ddRect.x = static_cast<int32_t>(x * _dirtyGrid.BlockWidth * scaleX);
ddRect.y = static_cast<int32_t>(y * _dirtyGrid.BlockHeight * scaleY);