1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 00:04:43 +01:00

Remove gCommonStringFormatBuffer, CommonTextBufferSize

This commit is contained in:
Aaron van Geffen
2024-07-13 13:25:55 +02:00
parent a97820f297
commit c08541efc7
7 changed files with 14 additions and 17 deletions

View File

@@ -715,8 +715,9 @@ void CustomListView::PaintSeperator(
DrawTextBasic(dpi, { centreX, pos.y }, STR_STRING, ft, { baseColour, TextAlignment::CENTRE });
// Get string dimensions
FormatStringLegacy(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_STRING, ft.Data());
int32_t categoryStringHalfWidth = (GfxGetStringWidth(gCommonStringFormatBuffer, FontStyle::Medium) / 2) + 4;
utf8 stringBuffer[512]{};
FormatStringLegacy(stringBuffer, sizeof(stringBuffer), STR_STRING, ft.Data());
int32_t categoryStringHalfWidth = (GfxGetStringWidth(stringBuffer, FontStyle::Medium) / 2) + 4;
int32_t strLeft = centreX - categoryStringHalfWidth;
int32_t strRight = centreX + categoryStringHalfWidth;