1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Make DrawOpenRCT2 use ScreenCoordsXY

This commit is contained in:
Tulio Leao
2020-06-21 16:30:58 -03:00
parent f535a4a0c4
commit 1a7943a5ab
3 changed files with 6 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ void Painter::Paint(IDrawingEngine& de)
if ((gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) && !title_should_hide_version_info())
{
DrawOpenRCT2(dpi, 0, _uiContext->GetHeight() - 20);
DrawOpenRCT2(dpi, { 0, _uiContext->GetHeight() - 20 });
}
gfx_draw_pickedup_peep(dpi);

View File

@@ -427,10 +427,9 @@ bool title_is_previewing_sequence()
return false;
}
void DrawOpenRCT2(rct_drawpixelinfo* dpi, int32_t x, int32_t y)
void DrawOpenRCT2(rct_drawpixelinfo* dpi, const ScreenCoordsXY& screenCoords)
{
utf8 buffer[256];
ScreenCoordsXY screenCoords(x, y);
// Write format codes
utf8* ch = buffer;
@@ -444,7 +443,9 @@ void DrawOpenRCT2(rct_drawpixelinfo* dpi, int32_t x, int32_t y)
// Invalidate screen area
int16_t width = static_cast<int16_t>(gfx_get_string_width(buffer));
gfx_set_dirty_blocks(x, y, x + width, y + 30); // 30 is an arbitrary height to catch both strings
gfx_set_dirty_blocks(
screenCoords.x, screenCoords.y, screenCoords.x + width,
screenCoords.y + 30); // 30 is an arbitrary height to catch both strings
// Write platform information
snprintf(ch, 256 - (ch - buffer), "%s (%s)", OPENRCT2_PLATFORM, OPENRCT2_ARCHITECTURE);

View File

@@ -65,4 +65,4 @@ size_t title_get_current_sequence();
bool title_preview_sequence(size_t value);
void title_stop_previewing_sequence();
bool title_is_previewing_sequence();
void DrawOpenRCT2(rct_drawpixelinfo* dpi, int32_t x, int32_t y);
void DrawOpenRCT2(rct_drawpixelinfo* dpi, const ScreenCoordsXY& screenCoords);