1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 14:02:59 +01:00

Pass DPI by ref to string drawing

This commit is contained in:
Gymnasiast
2023-02-24 22:05:07 +01:00
parent 777fea6c8c
commit a15f72da87
75 changed files with 635 additions and 636 deletions

View File

@@ -207,12 +207,12 @@ public:
auto ft = Formatter();
ft.Add<const char*>(_description.c_str());
DrawTextWrapped(
&dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, STR_STRING, ft, { colours[1], TextAlignment::CENTRE });
}
else
{
DrawTextWrapped(
&dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, _descriptionArgs,
dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, _descriptionArgs,
{ colours[1], TextAlignment::CENTRE });
}
@@ -239,7 +239,7 @@ public:
for (int32_t line = 0; line <= no_lines; line++)
{
screenCoords.x = windowPos.x + 12;
DrawText(&dpi, screenCoords, { colours[1], FontStyle::Medium, TextAlignment::LEFT }, wrapPointer, true);
DrawText(dpi, screenCoords, { colours[1], FontStyle::Medium, TextAlignment::LEFT }, wrapPointer, true);
size_t string_length = GetStringSize(wrapPointer) - 1;
@@ -322,7 +322,7 @@ private:
&dpi, { screenCoords - ScreenCoordsXY{ 1, 1 }, screenCoords + ScreenCoordsXY{ width + 1, height + 1 } },
PALETTE_INDEX_12);
GfxFillRect(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ width, height } }, PALETTE_INDEX_0);
GfxDrawString(&dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
GfxDrawString(dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
}
void ExecuteCallback(bool hasValue)