Format required code.

This commit is contained in:
Harry-Hopkinson 2024-05-09 17:56:03 +00:00
parent 7ca957d822
commit b14670d018
3 changed files with 4 additions and 7 deletions

View File

@ -539,7 +539,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 }, static_cast<const char*>(buffer));
DrawText(dpi, screenCoords, { COLOUR_DARK_GREEN }, buffer);
if (entry.Generation == ObjectGeneration::DAT)
{

View File

@ -7,14 +7,13 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "../drawing/Text.h"
#include "../Context.h"
#include "../common.h"
#include "../config/Config.h"
#include "../core/String.hpp"
#include "../drawing/IDrawingContext.h"
#include "../drawing/IDrawingEngine.h"
#include "../drawing/Text.h"
#include "../interface/Viewport.h"
#include "../localisation/Formatting.h"
#include "../localisation/Localisation.h"
@ -332,8 +331,7 @@ void DrawStringCentredRaw(
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 }, text);
const utf8* ch = text;
const utf8* nextCh = nullptr;

View File

@ -288,8 +288,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 }, bufferPtr);
bufferPtr = GetStringEnd(bufferPtr) + 1;
lineY += lineHeight;
}