mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-02-02 11:45:13 +01:00
Replace kTextColour254 and kTextColour255 with COLOUR_NULL
This commit is contained in:
@@ -344,7 +344,7 @@ void InGameConsole::Draw(RenderTarget& rt) const
|
||||
if (textColour.colour == COLOUR_BLACK)
|
||||
{
|
||||
DrawText(rt, screenCoords, { textColour, style }, "{BLACK}");
|
||||
DrawText(rt, screenCoords, { kTextColour255, style }, _consoleLines[index].first.c_str(), true);
|
||||
DrawText(rt, screenCoords, { COLOUR_NULL, style }, _consoleLines[index].first.c_str(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -355,7 +355,7 @@ void InGameConsole::Draw(RenderTarget& rt) const
|
||||
{
|
||||
std::string lineColour = FormatTokenToStringWithBraces(_consoleLines[index].second);
|
||||
DrawText(rt, screenCoords, { textColour, style }, lineColour.c_str());
|
||||
DrawText(rt, screenCoords, { kTextColour255, style }, _consoleLines[index].first.c_str(), true);
|
||||
DrawText(rt, screenCoords, { COLOUR_NULL, style }, _consoleLines[index].first.c_str(), true);
|
||||
}
|
||||
|
||||
screenCoords.y += lineHeight;
|
||||
@@ -367,7 +367,7 @@ void InGameConsole::Draw(RenderTarget& rt) const
|
||||
if (textColour.colour == COLOUR_BLACK)
|
||||
{
|
||||
DrawText(rt, screenCoords, { textColour, style }, "{BLACK}");
|
||||
DrawText(rt, screenCoords, { kTextColour255, style }, _consoleCurrentLine.c_str(), true);
|
||||
DrawText(rt, screenCoords, { COLOUR_NULL, style }, _consoleCurrentLine.c_str(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -331,7 +331,7 @@ void DrawStringCentredRaw(
|
||||
for (int32_t i = 0; i <= numLines; i++)
|
||||
{
|
||||
int32_t width = GfxGetStringWidth(text, fontStyle);
|
||||
DrawText(rt, screenCoords - ScreenCoordsXY{ width / 2, 0 }, { kTextColour254, fontStyle }, text);
|
||||
DrawText(rt, screenCoords - ScreenCoordsXY{ width / 2, 0 }, { COLOUR_NULL, fontStyle }, text);
|
||||
|
||||
const utf8* ch = text;
|
||||
const utf8* nextCh = nullptr;
|
||||
@@ -462,7 +462,7 @@ void DrawNewsTicker(
|
||||
}
|
||||
|
||||
screenCoords = { coords.x - halfWidth, lineY };
|
||||
DrawText(rt, screenCoords, { kTextColour254, FontStyle::small }, buffer);
|
||||
DrawText(rt, screenCoords, { COLOUR_NULL, FontStyle::small }, buffer);
|
||||
|
||||
if (numCharactersDrawn > numCharactersToDraw)
|
||||
{
|
||||
@@ -749,7 +749,7 @@ static void TTFProcessString(RenderTarget& rt, std::string_view text, TextDrawIn
|
||||
|
||||
static void TTFProcessInitialColour(ColourWithFlags colour, TextDrawInfo* info)
|
||||
{
|
||||
if (colour.colour != kTextColour254 && colour.colour != kTextColour255)
|
||||
if (colour.colour != COLOUR_NULL)
|
||||
{
|
||||
info->colourFlags = colour.flags;
|
||||
if (!colour.flags.has(ColourFlag::inset))
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
for (int32_t line = 0; line < LineCount; ++line)
|
||||
{
|
||||
DrawText(rt, lineCoords, tempPaint, buffer);
|
||||
tempPaint.Colour = kTextColour254;
|
||||
tempPaint.Colour = COLOUR_NULL;
|
||||
buffer = GetStringEnd(buffer) + 1;
|
||||
lineCoords.y += LineHeight;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ void ChatDraw(RenderTarget& rt, ColourWithFlags chatBackgroundColor)
|
||||
auto ft = Formatter();
|
||||
ft.Add<const char*>(lineCh);
|
||||
inputLineHeight = DrawTextWrapped(
|
||||
rt, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { kTextColour255 });
|
||||
rt, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { COLOUR_NULL });
|
||||
GfxSetDirtyBlocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } });
|
||||
|
||||
// TODO: Show caret if the input text has multiple lines
|
||||
@@ -306,7 +306,7 @@ static int32_t ChatHistoryDrawString(RenderTarget& rt, const char* text, const S
|
||||
int32_t lineY = screenCoords.y;
|
||||
for (int32_t line = 0; line <= numLines; ++line)
|
||||
{
|
||||
DrawText(rt, { screenCoords.x, lineY - (numLines * lineHeight) }, { kTextColour254 }, bufferPtr);
|
||||
DrawText(rt, { screenCoords.x, lineY - (numLines * lineHeight) }, { COLOUR_NULL }, bufferPtr);
|
||||
bufferPtr = GetStringEnd(bufferPtr) + 1;
|
||||
lineY += lineHeight;
|
||||
}
|
||||
|
||||
@@ -99,9 +99,6 @@ enum
|
||||
constexpr uint8_t kColourNumOriginal = 32;
|
||||
constexpr uint8_t kColourNumNormal = 54;
|
||||
|
||||
constexpr colour_t kTextColour254 = 254;
|
||||
constexpr colour_t kTextColour255 = 255;
|
||||
|
||||
namespace OpenRCT2::Colour
|
||||
{
|
||||
colour_t FromString(std::string_view s, colour_t defaultValue = COLOUR_BLACK);
|
||||
|
||||
Reference in New Issue
Block a user