mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
Merge pull request #19480 from Gymnasiast/refactor/dpi-string
Pass DPI by ref to string drawing
This commit is contained in:
@@ -210,12 +210,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 });
|
||||
}
|
||||
|
||||
@@ -242,7 +242,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;
|
||||
|
||||
@@ -325,7 +325,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)
|
||||
|
||||
Reference in New Issue
Block a user