1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Fix #11570 - create gfx_draw_string_centered() overload (#11760)

* Fix #11570 - create gfx_draw_string_centered() overload

I created the overload, updated all calls from the old function to the new and deleted the old one
This commit is contained in:
TomasZilinek
2020-05-17 20:29:56 +02:00
committed by GitHub
parent e87343f9c6
commit 277080de74
20 changed files with 171 additions and 161 deletions

View File

@@ -604,7 +604,7 @@ static void window_scenarioselect_scrollpaint(rct_window* w, rct_drawpixelinfo*
{
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM_DARK;
}
gfx_draw_string_centred(dpi, format, wide ? 270 : 210, y + 1, colour, gCommonFormatArgs);
gfx_draw_string_centred(dpi, format, { wide ? 270 : 210, y + 1 }, colour, gCommonFormatArgs);
// Check if scenario is completed
if (isCompleted)
@@ -624,7 +624,7 @@ static void window_scenarioselect_scrollpaint(rct_window* w, rct_drawpixelinfo*
ft.Add<rct_string_id>(STR_STRING);
ft.Add<char*>(buffer);
gfx_draw_string_centred(
dpi, format, wide ? 270 : 210, y + scenarioTitleHeight + 1, COLOUR_BLACK, gCommonFormatArgs);
dpi, format, { wide ? 270 : 210, y + scenarioTitleHeight + 1 }, COLOUR_BLACK, gCommonFormatArgs);
}
y += scenarioItemHeight;
@@ -643,7 +643,7 @@ static void draw_category_heading(
// Draw string
int32_t centreX = (left + right) / 2;
gfx_draw_string_centred(dpi, stringId, centreX, y, baseColour, nullptr);
gfx_draw_string_centred(dpi, stringId, { centreX, y }, baseColour, nullptr);
// Get string dimensions
utf8* buffer = gCommonStringFormatBuffer;