diff --git a/src/drawing/string.c b/src/drawing/string.c index da4c717875..b356523f7b 100644 --- a/src/drawing/string.c +++ b/src/drawing/string.c @@ -335,24 +335,7 @@ void gfx_draw_string_right(rct_drawpixelinfo* dpi, int format, void* args, int c */ void gfx_draw_string_centred(rct_drawpixelinfo *dpi, int format, int x, int y, int colour, void *args) { - char* buffer; - int text_width; - - buffer = RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char); - format_string(buffer, format, args); - - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 0xE0; - - // Measure text width - text_width = gfx_get_string_width(buffer); - - // Draw the text centred - if (text_width <= 0xFFFF && text_width >= 0) { - x -= text_width / 2; - gfx_draw_string(dpi, buffer, colour, x, y); - } else { - log_warning("improper text width %d for string %s", text_width, buffer); - } + gfx_draw_string_centred_wrapped(dpi, args, x, y, INT32_MAX, format, colour); } /**