From 89fde291c4d0eafa9967011ca84f19d9958ce7e8 Mon Sep 17 00:00:00 2001 From: Harry-Hopkinson Date: Thu, 9 May 2024 16:09:31 +0000 Subject: [PATCH] Attempt to fix Windows build errors. --- src/openrct2-ui/windows/ObjectLoadError.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 2 +- src/openrct2/drawing/Drawing.String.cpp | 10 +++++----- src/openrct2/interface/Chat.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 1016c1614a..72bf7e8f5d 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -538,7 +538,7 @@ static Widget window_object_load_error_widgets[] = { auto name = entry.GetName(); char buffer[256]; String::Set(buffer, sizeof(buffer), name.data(), name.size()); - DrawText(dpi, screenCoords, { COLOUR_DARK_GREEN }, buffer); + DrawText(dpi, screenCoords, { COLOUR_DARK_GREEN }, static_cast(buffer)); if (entry.Generation == ObjectGeneration::DAT) { diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 8b2af0256f..5acfbfcd69 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -423,7 +423,7 @@ static Widget _serverListWidgets[] = { // Draw number of players screenCoords.x = right - numPlayersStringWidth; - DrawText(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, { colours[1] }, players); + DrawText(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, { colours[1] }, static_cast(players)); screenCoords.y += ITEM_HEIGHT; } diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 17bb5f9aaf..9233e86b61 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -262,7 +262,7 @@ void GfxDrawStringLeftCentred(DrawPixelInfo& dpi, StringId format, void* args, c auto bufferPtr = buffer; FormatStringLegacy(bufferPtr, sizeof(buffer), format, args); int32_t height = StringGetHeightRaw(bufferPtr, FontStyle::Medium); - DrawText(dpi, coords - ScreenCoordsXY{ 0, (height / 2) }, { colour }, bufferPtr); + DrawText(dpi, coords - ScreenCoordsXY{ 0, (height / 2) }, { colour }, static_cast(bufferPtr)); } /** @@ -324,13 +324,13 @@ void DrawStringCentredRaw( DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle) { ScreenCoordsXY screenCoords(dpi.x, dpi.y); - DrawText(dpi, screenCoords, { COLOUR_BLACK, fontStyle }, ""); + DrawText(dpi, screenCoords, { COLOUR_BLACK, fontStyle }, static_cast("")); screenCoords = coords; for (int32_t i = 0; i <= numLines; i++) { int32_t width = GfxGetStringWidth(text, fontStyle); - DrawText(dpi, screenCoords - ScreenCoordsXY{ width / 2, 0 }, { TEXT_COLOUR_254, fontStyle }, text); + DrawText(dpi, screenCoords - ScreenCoordsXY{ width / 2, 0 }, { TEXT_COLOUR_254, fontStyle }, static_cast(text)); const utf8* ch = text; const utf8* nextCh = nullptr; @@ -422,7 +422,7 @@ void DrawNewsTicker( int32_t numLines, lineHeight, lineY; ScreenCoordsXY screenCoords(dpi.x, dpi.y); - DrawText(dpi, screenCoords, { colour }, ""); + DrawText(dpi, screenCoords, { colour }, static_cast("")); u8string wrappedString; GfxWrapString(FormatStringID(format, args), width, FontStyle::Small, &wrappedString, &numLines); @@ -461,7 +461,7 @@ void DrawNewsTicker( } screenCoords = { coords.x - halfWidth, lineY }; - DrawText(dpi, screenCoords, { TEXT_COLOUR_254, FontStyle::Small }, buffer); + DrawText(dpi, screenCoords, { TEXT_COLOUR_254, FontStyle::Small }, static_cast(buffer)); if (numCharactersDrawn > numCharactersToDraw) { diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 0a8de0675a..9eac70080c 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -287,7 +287,7 @@ static int32_t ChatHistoryDrawString(DrawPixelInfo& dpi, const char* text, const int32_t lineY = screenCoords.y; for (int32_t line = 0; line <= numLines; ++line) { - DrawText(dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, { TEXT_COLOUR_254 }, bufferPtr); + DrawText(dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, { TEXT_COLOUR_254 }, static_cast(bufferPtr)); bufferPtr = GetStringEnd(bufferPtr) + 1; lineY += lineHeight; }