Merge pull request #20744 from ZehMatt/fix-20739

Fix #20739: Build version info leaving stray pixels when moving camera
This commit is contained in:
Matthias Moninger 2023-08-27 22:28:43 +03:00 committed by GitHub
commit 3cffbcc43d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -40,6 +40,7 @@
- Fix: [#20659] Phantom rides remain when closing construction window while paused.
- Fix: [#20684] Footpath additions getting removed by Miniature railway ghost elements.
- Fix: [#20693] Incorrect information shown when hovering over station when another station before it was removed.
- Fix: [#20739] Build version info on title screen leaving stray pixels when the camera is moved.
0.4.5 (2023-05-08)
------------------------------------------------------------------------

View File

@ -448,12 +448,9 @@ void DrawOpenRCT2(DrawPixelInfo& dpi, const ScreenCoordsXY& screenCoords)
// Write name and version information
buffer += gVersionInfoFull;
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 5 - 13), buffer.c_str(), { COLOUR_BLACK });
// Invalidate screen area
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 5 - 13), buffer.c_str(), { COLOUR_BLACK });
int16_t width = static_cast<int16_t>(GfxGetStringWidth(buffer, FontStyle::Medium));
GfxSetDirtyBlocks(
{ screenCoords, screenCoords + ScreenCoordsXY{ width, 30 } }); // 30 is an arbitrary height to catch both strings
// Write platform information
buffer.assign("{OUTLINE}{WHITE}");
@ -461,5 +458,11 @@ void DrawOpenRCT2(DrawPixelInfo& dpi, const ScreenCoordsXY& screenCoords)
buffer.append(" (");
buffer.append(OPENRCT2_ARCHITECTURE);
buffer.append(")");
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 5), buffer.c_str(), { COLOUR_BLACK });
width = std::max(width, static_cast<int16_t>(GfxGetStringWidth(buffer, FontStyle::Medium)));
// Invalidate screen area
GfxSetDirtyBlocks({ screenCoords - ScreenCoordsXY(0, 13),
screenCoords + ScreenCoordsXY{ width + 5, 30 } }); // 30 is an arbitrary height to catch both strings
}