From 3a8bf352ac6fe2c1224ad8cebb648a42050b9058 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 13 Aug 2018 20:34:06 +0200 Subject: [PATCH 1/2] Fix #7804: Russian ride descriptions cut off --- distribution/changelog.txt | 1 + src/openrct2/drawing/Text.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index baec0cc95d..17805978f4 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -33,6 +33,7 @@ - Fix: [#7793] Duplicate private keys generated. - Fix: [#7817] No sprite font glyph for interpunct. - Fix: [#7823] You can build mazes in pause mode. +- Fix: [#7804] Russian ride descriptions are cut off. 0.2.0 (2018-06-10) ------------------------------------------------------------------------ diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index e89cb29878..dfc1e8b1fa 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -107,7 +107,7 @@ static void DrawText(rct_drawpixelinfo* dpi, int32_t x, int32_t y, TextPaint* pa static void DrawText(rct_drawpixelinfo* dpi, int32_t x, int32_t y, TextPaint* paint, rct_string_id format, void* args) { - utf8 buffer[256]; + utf8 buffer[512]; format_string(buffer, sizeof(buffer), format, args); DrawText(dpi, x, y, paint, buffer); } @@ -134,7 +134,7 @@ static void DrawTextEllipsisedCompat( _legacyPaint.SpriteBase = FONT_SPRITE_BASE_MEDIUM; gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM; - utf8 buffer[256]; + utf8 buffer[512]; format_string(buffer, sizeof(buffer), format, args); gfx_clip_string(buffer, width); @@ -206,7 +206,7 @@ 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) { - utf8 buffer[256]; + utf8 buffer[512]; format_string(buffer, sizeof(buffer), format, args); gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM; @@ -225,7 +225,7 @@ int32_t gfx_draw_string_left_wrapped( int32_t gfx_draw_string_centred_wrapped( rct_drawpixelinfo* dpi, void* args, int32_t x, int32_t y, int32_t width, rct_string_id format, uint8_t colour) { - utf8 buffer[256]; + utf8 buffer[512]; format_string(buffer, sizeof(buffer), format, args); gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM; From 6fc86d576625fe063e6ed9a11888b96a31675061 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 13 Aug 2018 21:13:20 +0200 Subject: [PATCH 2/2] Fix #7872: CJK tooltips are often cut off --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Tooltip.cpp | 2 +- src/openrct2/localisation/Localisation.cpp | 2 +- src/openrct2/localisation/Localisation.h | 2 +- src/openrct2/paint/tile_element/Paint.Banner.cpp | 4 ++-- src/openrct2/paint/tile_element/Paint.Path.cpp | 5 +++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 17805978f4..eb9fa7fec6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -34,6 +34,7 @@ - Fix: [#7817] No sprite font glyph for interpunct. - Fix: [#7823] You can build mazes in pause mode. - Fix: [#7804] Russian ride descriptions are cut off. +- Fix: [#7872] CJK tooltips are often cut off. 0.2.0 (2018-06-10) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 83ced24de1..63b7ca6d79 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -84,7 +84,7 @@ void window_tooltip_show(rct_string_id id, int32_t x, int32_t y) char* buffer = gCommonStringFormatBuffer; - format_string(buffer, 256, id, gCommonFormatArgs); + format_string(buffer, sizeof(gCommonStringFormatBuffer), id, gCommonFormatArgs); gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM; int32_t tooltip_text_width; diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index fa6d882fa7..41c2744937 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -35,7 +35,7 @@ #include "Date.h" #include "Localisation.h" -char gCommonStringFormatBuffer[256]; +char gCommonStringFormatBuffer[512]; uint8_t gCommonFormatArgs[80]; uint8_t gMapTooltipFormatArgs[40]; diff --git a/src/openrct2/localisation/Localisation.h b/src/openrct2/localisation/Localisation.h index 03c7aadb36..2efa28b023 100644 --- a/src/openrct2/localisation/Localisation.h +++ b/src/openrct2/localisation/Localisation.h @@ -63,7 +63,7 @@ extern const char real_name_initials[16]; extern const char* real_names[1024]; extern utf8 gUserStrings[MAX_USER_STRINGS][USER_STRING_MAX_LENGTH]; -extern char gCommonStringFormatBuffer[256]; +extern char gCommonStringFormatBuffer[512]; extern uint8_t gCommonFormatArgs[80]; extern uint8_t gMapTooltipFormatArgs[40]; extern bool gDebugStringFormatting; diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index ae583fffb6..48f5700dd6 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -103,11 +103,11 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con } if (gConfigGeneral.upper_case_banners) { - format_string_to_upper(gCommonStringFormatBuffer, 256, string_id, gCommonFormatArgs); + format_string_to_upper(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), string_id, gCommonFormatArgs); } else { - format_string(gCommonStringFormatBuffer, 256, string_id, gCommonFormatArgs); + format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), string_id, gCommonFormatArgs); } gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 2ec2da2579..466cd3ed8a 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -454,11 +454,12 @@ static void sub_6A4101( } if (gConfigGeneral.upper_case_banners) { - format_string_to_upper(gCommonStringFormatBuffer, 256, string_id, gCommonFormatArgs); + format_string_to_upper( + gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), string_id, gCommonFormatArgs); } else { - format_string(gCommonStringFormatBuffer, 256, string_id, gCommonFormatArgs); + format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), string_id, gCommonFormatArgs); } gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY;