From 575bae7ac44a1395d191faf38a65664c7fc0ab93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 30 Jul 2022 14:21:34 -0700 Subject: [PATCH] Rename global variable text_palette -> gTextPalette (#17647) --- src/openrct2/drawing/Drawing.String.cpp | 8 ++++---- src/openrct2/drawing/Drawing.cpp | 2 +- src/openrct2/drawing/Drawing.h | 2 +- src/openrct2/drawing/Text.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 41165d0348..5ab3b1decd 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -992,10 +992,10 @@ void ttf_draw_string( info.flags |= TEXT_DRAW_FLAG_NO_FORMATTING; } - std::memcpy(info.palette, text_palette, sizeof(info.palette)); + std::memcpy(info.palette, gTextPalette, sizeof(info.palette)); ttf_process_initial_colour(colour, &info); ttf_process_string(dpi, text, &info); - std::memcpy(text_palette, info.palette, sizeof(info.palette)); + std::memcpy(gTextPalette, info.palette, sizeof(info.palette)); dpi->lastStringPos = { info.x, info.y }; } @@ -1052,10 +1052,10 @@ void gfx_draw_string_with_y_offsets( info.flags |= TEXT_DRAW_FLAG_TTF; } - std::memcpy(info.palette, text_palette, sizeof(info.palette)); + std::memcpy(info.palette, gTextPalette, sizeof(info.palette)); ttf_process_initial_colour(colour, &info); ttf_process_string(dpi, text, &info); - std::memcpy(text_palette, info.palette, sizeof(info.palette)); + std::memcpy(gTextPalette, info.palette, sizeof(info.palette)); dpi->lastStringPos = { info.x, info.y }; } diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 00e586de66..8ab8e01066 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -141,7 +141,7 @@ thread_local uint8_t gOtherPalette[256] = { }; // Originally 0x9ABE04 -uint8_t text_palette[0x8] = { +uint8_t gTextPalette[0x8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 1d67b5f213..898aaff453 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -481,7 +481,7 @@ extern uint32_t gPaletteEffectFrame; extern const FilterPaletteID GlassPaletteIds[COLOUR_COUNT]; extern thread_local uint8_t gPeepPalette[256]; extern thread_local uint8_t gOtherPalette[256]; -extern uint8_t text_palette[]; +extern uint8_t gTextPalette[]; extern const translucent_window_palette TranslucentWindowPalettes[COLOUR_COUNT]; extern ImageId gPickupPeepImage; diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index 63b530c18d..52cfc25599 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -106,12 +106,12 @@ static void DrawText( { gfx_fill_rect( dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } }, - text_palette[1]); - if (text_palette[2] != 0) + gTextPalette[1]); + if (gTextPalette[2] != 0) { gfx_fill_rect( dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } }, - text_palette[2]); + gTextPalette[2]); } } }