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:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user