forked from rosebudai/OpenRCT2-Web
Part of #11562: gfx_draw_string_left_wrapped() overload
* gfx_draw_string_left_wrapped overload added Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
1 parent
d93edf77d6
commit
310ff84b23
3 files changed
+10
-2
No files matched your search
@@ -987,7 +987,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
|
||||
ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(gS6Info.details);
|
||||
gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, width, STR_BLACK_STRING, COLOUR_BLACK);
|
||||
gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, { x, y }, width, STR_BLACK_STRING, COLOUR_BLACK);
|
||||
|
||||
// Scenario category label
|
||||
x = w->windowPos.x + 8;
|
||||
|
||||
@@ -556,6 +556,8 @@ void gfx_draw_string_right_clipped(
|
||||
|
||||
int32_t gfx_draw_string_left_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, int32_t x, int32_t y, int32_t width, rct_string_id format, uint8_t colour);
|
||||
int32_t gfx_draw_string_left_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, uint8_t colour);
|
||||
int32_t gfx_draw_string_centred_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, uint8_t colour);
|
||||
|
||||
|
||||
@@ -212,6 +212,12 @@ void gfx_draw_string_right_clipped(
|
||||
// Wrapping
|
||||
int32_t gfx_draw_string_left_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, int32_t x, int32_t y, int32_t width, rct_string_id format, uint8_t colour)
|
||||
{
|
||||
return gfx_draw_string_left_wrapped(dpi, args, { x, y }, width, format, colour);
|
||||
}
|
||||
|
||||
int32_t gfx_draw_string_left_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, uint8_t colour)
|
||||
{
|
||||
utf8 buffer[512];
|
||||
format_string(buffer, sizeof(buffer), format, args);
|
||||
@@ -224,7 +230,7 @@ int32_t gfx_draw_string_left_wrapped(
|
||||
_legacyPaint.SpriteBase = gCurrentFontSpriteBase;
|
||||
|
||||
StaticLayout layout(buffer, _legacyPaint, width);
|
||||
layout.Draw(dpi, x, y);
|
||||
layout.Draw(dpi, coords.x, coords.y);
|
||||
|
||||
return layout.GetHeight();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user