From 975eacc5f9013dd1c792f7ebefdc388ee9fe16dd Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 16 May 2016 18:44:44 +0100 Subject: [PATCH] add temp RCT2 memory copy for scrolling text paint Fixes #3628: assertion Fixes #3634: wrong queue banner text Until path_paint is implemented, this variable is used by scrolling_text_setup to use the old string arguments array. Remove when scrolling_text_setup is no longer hooked. --- src/drawing/scrolling_text.c | 6 ++++++ src/paint/map_element/path.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/drawing/scrolling_text.c b/src/drawing/scrolling_text.c index 12de3e4efc..4ba9537cd7 100644 --- a/src/drawing/scrolling_text.c +++ b/src/drawing/scrolling_text.c @@ -125,6 +125,8 @@ static void scrolling_text_format(utf8 *dst, rct_draw_scroll_text *scrollText) } } +extern bool TempForScrollText; + /** * * rct2: 0x006C42D9 @@ -135,6 +137,10 @@ static void scrolling_text_format(utf8 *dst, rct_draw_scroll_text *scrollText) */ int scrolling_text_setup(rct_string_id stringId, uint16 scroll, uint16 scrollingMode) { + if (TempForScrollText) { + memcpy(gCommonFormatArgs, (const void*)0x013CE952, 16); + } + rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); if (dpi->zoom_level != 0) return 0x626; diff --git a/src/paint/map_element/path.c b/src/paint/map_element/path.c index 43e91d5ec5..ce9b3b83e4 100644 --- a/src/paint/map_element/path.c +++ b/src/paint/map_element/path.c @@ -18,6 +18,13 @@ #include "../../addresses.h" #include "../../world/map.h" +// #3628: Until path_paint is implemented, this variable is used by scrolling_text_setup +// to use the old string arguments array. Remove when scrolling_text_setup is no +// longer hooked. +bool TempForScrollText = false; + void path_paint(uint8 direction, uint16 height, rct_map_element *mapElement) { + TempForScrollText = true; RCT2_CALLPROC_X(0x6A3590, 0, 0, direction, height, (int)mapElement, 0, 0); + TempForScrollText = false; }