diff --git a/src/openrct2-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index acc26d7782..007d5a3279 100644 --- a/src/openrct2-ui/interface/Graph.cpp +++ b/src/openrct2-ui/interface/Graph.cpp @@ -29,7 +29,7 @@ namespace Graph auto ft = Formatter(); ft.Add(DateGameShortMonthNames[DateGetMonth((yearOver32 / 4) + MONTH_COUNT)]); DrawTextBasic( - dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft, + *dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft, { FontStyle::Small, TextAlignment::CENTRE }); // Draw month mark @@ -166,7 +166,7 @@ namespace Graph auto ft = Formatter(); ft.Add(DateGameShortMonthNames[DateGetMonth((yearOver32 / 4) + MONTH_COUNT)]); DrawTextBasic( - dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft, + *dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft, { FontStyle::Small, TextAlignment::CENTRE }); // Draw month mark @@ -264,7 +264,7 @@ namespace Graph auto ft = Formatter(); ft.Add(info.money); DrawTextBasic( - dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE }); + *dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE }); GfxFillRect(dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10); GfxFillRect( diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index d850762e96..3227772069 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -314,7 +314,7 @@ void InGameConsole::Draw(DrawPixelInfo* dpi) const { const size_t index = i + _consoleScrollPos; lineBuffer = _colourFormatStr + _consoleLines[index]; - GfxDrawString(dpi, screenCoords, lineBuffer.c_str(), { textColour, InGameConsoleGetFontStyle() }); + GfxDrawString(*dpi, screenCoords, lineBuffer.c_str(), { textColour, InGameConsoleGetFontStyle() }); screenCoords.y += lineHeight; } @@ -322,7 +322,7 @@ void InGameConsole::Draw(DrawPixelInfo* dpi) const // Draw current line lineBuffer = _colourFormatStr + _consoleCurrentLine; - DrawText(dpi, screenCoords, { TEXT_COLOUR_255, InGameConsoleGetFontStyle() }, lineBuffer.c_str(), true); + DrawText(*dpi, screenCoords, { TEXT_COLOUR_255, InGameConsoleGetFontStyle() }, lineBuffer.c_str(), true); // Draw caret if (_consoleCaretTicks < CONSOLE_CARET_FLASH_THRESHOLD) diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 03ba5f3c74..328c0343b9 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -368,11 +368,11 @@ static void WidgetTextCentred(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid ScreenCoordsXY coords = { (topLeft.x + r + 1) / 2 - 1, topLeft.y }; if (widget.type == WindowWidgetType::LabelCentred) { - DrawTextWrapped(dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE }); } else { - DrawTextEllipsised(dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE }); + DrawTextEllipsised(*dpi, coords, widget.width() - 2, stringId, ft, { colour, TextAlignment::CENTRE }); } } @@ -417,11 +417,11 @@ static void WidgetText(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex widgetInde ScreenCoordsXY coords = { l + 1, t }; if (widget.type == WindowWidgetType::LabelCentred) { - DrawTextWrapped(dpi, coords, r - l, stringId, ft, { colour, TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, coords, r - l, stringId, ft, { colour, TextAlignment::CENTRE }); } else { - DrawTextEllipsised(dpi, coords, r - l, stringId, ft, colour); + DrawTextEllipsised(*dpi, coords, r - l, stringId, ft, colour); } } @@ -491,7 +491,7 @@ static void WidgetGroupboxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wi OpenRCT2::FormatStringLegacy(buffer, sizeof(buffer), stringId, formatArgs); auto ft = Formatter(); ft.Add(buffer); - DrawTextBasic(dpi, { l, t }, STR_STRING, ft, { colour }); + DrawTextBasic(*dpi, { l, t }, STR_STRING, ft, { colour }); textRight = l + GfxGetStringWidth(buffer, FontStyle::Medium) + 1; } @@ -571,7 +571,7 @@ static void WidgetCaptionDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid } topLeft.x += width / 2; DrawTextEllipsised( - dpi, topLeft, width, widget->text, Formatter::Common(), + *dpi, topLeft, width, widget->text, Formatter::Common(), { COLOUR_WHITE | static_cast(COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE }); } @@ -609,7 +609,7 @@ static void WidgetCloseboxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wi if (WidgetIsDisabled(w, widgetIndex)) colour |= COLOUR_FLAG_INSET; - DrawTextEllipsised(dpi, topLeft, widget.width() - 2, widget.text, Formatter::Common(), { colour, TextAlignment::CENTRE }); + DrawTextEllipsised(*dpi, topLeft, widget.width() - 2, widget.text, Formatter::Common(), { colour, TextAlignment::CENTRE }); } /** @@ -641,7 +641,7 @@ static void WidgetCheckboxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wi if (WidgetIsPressed(w, widgetIndex)) { GfxDrawString( - dpi, { midLeft - ScreenCoordsXY{ 0, 5 } }, static_cast(CheckBoxMarkString), + *dpi, { midLeft - ScreenCoordsXY{ 0, 5 } }, static_cast(CheckBoxMarkString), { static_cast(NOT_TRANSLUCENT(colour)) }); } @@ -650,7 +650,7 @@ static void WidgetCheckboxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wi return; auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget); - GfxDrawStringLeftCentred(dpi, stringId, formatArgs, colour, { midLeft + ScreenCoordsXY{ 14, 0 } }); + GfxDrawStringLeftCentred(*dpi, stringId, formatArgs, colour, { midLeft + ScreenCoordsXY{ 14, 0 } }); } /** @@ -742,7 +742,7 @@ static void WidgetHScrollbarDraw( uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; GfxFillRectInset(dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags); - GfxDrawString(dpi, { l + 1, t }, static_cast(BlackLeftArrowString), {}); + GfxDrawString(*dpi, { l + 1, t }, static_cast(BlackLeftArrowString), {}); } // Thumb @@ -759,7 +759,7 @@ static void WidgetHScrollbarDraw( uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; GfxFillRectInset(dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags); - GfxDrawString(dpi, { r - 6, t }, static_cast(BlackRightArrowString), {}); + GfxDrawString(*dpi, { r - 6, t }, static_cast(BlackRightArrowString), {}); } } @@ -779,7 +779,7 @@ static void WidgetVScrollbarDraw( GfxFillRectInset( dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour, ((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); - GfxDrawString(dpi, { l + 1, t - 1 }, static_cast(BlackUpArrowString), {}); + GfxDrawString(*dpi, { l + 1, t - 1 }, static_cast(BlackUpArrowString), {}); // Thumb GfxFillRectInset( @@ -792,7 +792,7 @@ static void WidgetVScrollbarDraw( GfxFillRectInset( dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour, ((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); - GfxDrawString(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast(BlackDownArrowString), {}); + GfxDrawString(*dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast(BlackDownArrowString), {}); } /** @@ -1148,7 +1148,7 @@ static void WidgetTextBoxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid { u8string wrappedString; GfxWrapString(widget.string, bottomRight.x - topLeft.x - 5, FontStyle::Medium, &wrappedString, nullptr); - DrawText(dpi, { topLeft.x + 2, topLeft.y }, { w.colours[1] }, wrappedString.c_str(), true); + DrawText(*dpi, { topLeft.x + 2, topLeft.y }, { w.colours[1] }, wrappedString.c_str(), true); } return; } @@ -1158,7 +1158,7 @@ static void WidgetTextBoxDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex wid u8string wrappedString; GfxWrapString(gTextBoxInput, bottomRight.x - topLeft.x - 5 - 6, FontStyle::Medium, &wrappedString, nullptr); - DrawText(dpi, { topLeft.x + 2, topLeft.y }, { w.colours[1] }, wrappedString.c_str(), true); + DrawText(*dpi, { topLeft.x + 2, topLeft.y }, { w.colours[1] }, wrappedString.c_str(), true); // Make a trimmed view of the string for measuring the width. int32_t curX = topLeft.x diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index 3e516da361..903a5bb8c0 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -683,13 +683,13 @@ void CustomListView::PaintHeading( { auto ft = Formatter(); ft.Add(STR_UP); - DrawTextBasic(dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT }); + DrawTextBasic(*dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT }); } else if (sortOrder == ColumnSortOrder::Descending) { auto ft = Formatter(); ft.Add(STR_DOWN); - DrawTextBasic(dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT }); + DrawTextBasic(*dpi, pos + ScreenCoordsXY{ size.width - 1, 0 }, STR_BLACK_STRING, ft, { TextAlignment::RIGHT }); } } @@ -712,7 +712,7 @@ void CustomListView::PaintSeperator( // Draw string Formatter ft; ft.Add(text); - DrawTextBasic(dpi, { centreX, pos.y }, STR_STRING, ft, { baseColour, TextAlignment::CENTRE }); + DrawTextBasic(*dpi, { centreX, pos.y }, STR_STRING, ft, { baseColour, TextAlignment::CENTRE }); // Get string dimensions FormatStringLegacy(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_STRING, ft.Data()); @@ -760,7 +760,7 @@ void CustomListView::PaintCell( auto ft = Formatter(); ft.Add(STR_STRING); ft.Add(text); - DrawTextEllipsised(dpi, pos, size.width, stringId, ft, {}); + DrawTextEllipsised(*dpi, pos, size.width, stringId, ft, {}); } std::optional CustomListView::GetItemIndexAt(const ScreenCoordsXY& pos) diff --git a/src/openrct2-ui/scripting/ScGraphicsContext.hpp b/src/openrct2-ui/scripting/ScGraphicsContext.hpp index 9255860432..5f6d411810 100644 --- a/src/openrct2-ui/scripting/ScGraphicsContext.hpp +++ b/src/openrct2-ui/scripting/ScGraphicsContext.hpp @@ -235,7 +235,7 @@ namespace OpenRCT2::Scripting void text(const std::string& text, int32_t x, int32_t y) { - GfxDrawString(&_dpi, { x, y }, text.c_str(), { _colour.value_or(0) }); + GfxDrawString(_dpi, { x, y }, text.c_str(), { _colour.value_or(0) }); } }; } // namespace OpenRCT2::Scripting diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index e052932374..6013a4938d 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -149,13 +149,13 @@ public: auto ft = Formatter(); ft.Add(STR_TITLE_SEQUENCE_OPENRCT2); DrawTextWrapped( - &dpi, aboutOpenRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); + dpi, aboutOpenRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); } { auto ft = Formatter(); ft.Add(STR_TITLE_SEQUENCE_RCT2); DrawTextWrapped( - &dpi, aboutRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); + dpi, aboutRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); } if (page == WINDOW_ABOUT_PAGE_OPENRCT2) @@ -214,7 +214,7 @@ private: auto centreX = versionPlaceholder.left + versionPlaceHolderWidth / 2; auto centreY = (versionPlaceholder.top + versionPlaceholder.bottom - FontGetLineHeight(FontStyle::Medium)) / 2; auto centrePos = windowPos + ScreenCoordsXY(centreX, centreY); - DrawTextWrapped(&dpi, centrePos, versionPlaceHolderWidth, STR_STRING, ft, { colours[1], TextAlignment::CENTRE }); + DrawTextWrapped(dpi, centrePos, versionPlaceHolderWidth, STR_STRING, ft, { colours[1], TextAlignment::CENTRE }); // Shows the update available button if (OpenRCT2::GetContext()->HasNewVersionInfo()) @@ -236,23 +236,23 @@ private: int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); // Credits - DrawTextBasic(&dpi, screenCoords, STR_COPYRIGHT_CS, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COPYRIGHT_CS, {}, { TextAlignment::CENTRE }); screenCoords.y += lineHeight + 74; - DrawTextBasic(&dpi, screenCoords, STR_DESIGNED_AND_PROGRAMMED_BY_CS, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_DESIGNED_AND_PROGRAMMED_BY_CS, {}, { TextAlignment::CENTRE }); screenCoords.y += lineHeight; - DrawTextBasic(&dpi, screenCoords, STR_GRAPHICS_BY_SF, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_GRAPHICS_BY_SF, {}, { TextAlignment::CENTRE }); screenCoords.y += lineHeight; - DrawTextBasic(&dpi, screenCoords, STR_SOUND_AND_MUSIC_BY_AB, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_SOUND_AND_MUSIC_BY_AB, {}, { TextAlignment::CENTRE }); screenCoords.y += lineHeight; - DrawTextBasic(&dpi, screenCoords, STR_ADDITIONAL_SOUNDS_RECORDED_BY_DE, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_ADDITIONAL_SOUNDS_RECORDED_BY_DE, {}, { TextAlignment::CENTRE }); screenCoords.y += lineHeight + 3; - DrawTextBasic(&dpi, screenCoords, STR_REPRESENTATION_BY_JL, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_REPRESENTATION_BY_JL, {}, { TextAlignment::CENTRE }); screenCoords.y += 2 * lineHeight + 5; - DrawTextBasic(&dpi, screenCoords, STR_THANKS_TO, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_THANKS_TO, {}, { TextAlignment::CENTRE }); screenCoords.y += lineHeight; - DrawTextBasic(&dpi, screenCoords, STR_THANKS_TO_PEOPLE, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_THANKS_TO_PEOPLE, {}, { TextAlignment::CENTRE }); screenCoords.y += 2 * lineHeight + 5; - DrawTextBasic(&dpi, screenCoords, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, {}, { TextAlignment::CENTRE }); // Images GfxDrawSprite(&dpi, ImageId(SPR_CREDITS_CHRIS_SAWYER_SMALL), { windowPos.x + 92, yPage + 24 }); diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index 67c3daabdc..134058a170 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -248,7 +248,7 @@ private: GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark); } - DrawTextEllipsised(&dpi, { 16, y + 1 }, listWidth, stringId, ft); + DrawTextEllipsised(dpi, { 16, y + 1 }, listWidth, stringId, ft); auto checkboxSize = ItemHeight - 3; PaintCheckbox(dpi, { { 2, y + 1 }, { 2 + checkboxSize + 1, y + 1 + checkboxSize } }, isChecked); @@ -262,7 +262,7 @@ private: auto checkmark = Formatter(); checkmark.Add(STR_STRING); checkmark.Add(CheckBoxMarkString); - DrawTextBasic(&dpi, ScreenCoordsXY{ rect.GetLeft() + 1, rect.GetTop() }, STR_WINDOW_COLOUR_2_STRINGID, checkmark); + DrawTextBasic(dpi, ScreenCoordsXY{ rect.GetLeft() + 1, rect.GetTop() }, STR_WINDOW_COLOUR_2_STRINGID, checkmark); } } diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index d87c131f6e..75c3a89204 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -197,7 +197,7 @@ public: if (screenCoords.y + lineHeight < dpi.y || screenCoords.y >= dpi.y + dpi.height) continue; - GfxDrawString(&dpi, screenCoords, line.c_str(), { colours[0] }); + GfxDrawString(dpi, screenCoords, line.c_str(), { colours[0] }); } } diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 1269236167..d5d37fc14a 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -532,28 +532,28 @@ public: colour |= COLOUR_FLAG_INSET; } int32_t actual_month = _monthSpinnerValue - 1; - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_BOTTOM_TOOLBAR_CASH, ft, { colour }); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_YEAR); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_MONTH); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 240 }, STR_DAY); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_BOTTOM_TOOLBAR_CASH, ft, { colour }); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_YEAR); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_MONTH); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 240 }, STR_DAY); ft = Formatter(); ft.Add(_yearSpinnerValue); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ _xRcol, 198 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); + dpi, windowPos + ScreenCoordsXY{ _xRcol, 198 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); ft = Formatter(); ft.Add(actual_month); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ _xRcol, 219 }, STR_FORMAT_MONTH, ft, { colours[1], TextAlignment::RIGHT }); + dpi, windowPos + ScreenCoordsXY{ _xRcol, 219 }, STR_FORMAT_MONTH, ft, { colours[1], TextAlignment::RIGHT }); ft = Formatter(); ft.Add(_daySpinnerValue); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ _xRcol, 240 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); + dpi, windowPos + ScreenCoordsXY{ _xRcol, 240 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); } else if (page == WINDOW_CHEATS_PAGE_MISC) { { auto& widget = widgets[WIDX_WEATHER]; - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHANGE_WEATHER); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHANGE_WEATHER); } { @@ -562,25 +562,24 @@ public: auto& widget = widgets[WIDX_PARK_RATING_SPINNER]; DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 2 }, STR_FORMAT_INTEGER, ft, - { colours[1] }); + dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 2 }, STR_FORMAT_INTEGER, ft, { colours[1] }); } { auto& widget = widgets[WIDX_STAFF_SPEED]; - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHEAT_STAFF_SPEED); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHEAT_STAFF_SPEED); } } else if (page == WINDOW_CHEATS_PAGE_GUESTS) { - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 72 }, STR_CHEAT_GUEST_HAPPINESS); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_CHEAT_GUEST_ENERGY); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 114 }, STR_CHEAT_GUEST_HUNGER); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 135 }, STR_CHEAT_GUEST_THIRST); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 156 }, STR_CHEAT_GUEST_NAUSEA); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 177 }, STR_CHEAT_GUEST_NAUSEA_TOLERANCE); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_CHEAT_GUEST_TOILET); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 72 }, STR_CHEAT_GUEST_HAPPINESS); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_CHEAT_GUEST_ENERGY); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 114 }, STR_CHEAT_GUEST_HUNGER); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 135 }, STR_CHEAT_GUEST_THIRST); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 156 }, STR_CHEAT_GUEST_NAUSEA); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 177 }, STR_CHEAT_GUEST_NAUSEA_TOLERANCE); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_CHEAT_GUEST_TOILET); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY); } } diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 590df8173d..6685b3c356 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -182,7 +182,7 @@ public: { auto ft = Formatter(); ft.Add(gLandToolSize); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } // Draw cost amount @@ -192,7 +192,7 @@ public: ft.Add(gClearSceneryCost); screenCoords.x = window_clear_scenery_widgets[WIDX_PREVIEW].midX() + windowPos.x; screenCoords.y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 + 27; - DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } }; diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index b5806b2530..c6c79d6317 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -193,22 +193,22 @@ public: auto screenCoords = windowPos + ScreenCoordsXY{ 10, 30 }; - DrawTextBasic(&dpi, screenCoords, STR_RATE, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_RATE, {}, { colours[1] }); int32_t baseExchange = CurrencyDescriptors[EnumValue(CurrencyType::Pounds)].rate; ft = Formatter(); ft.Add(baseExchange); - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 200, 0 }, STR_CUSTOM_CURRENCY_EQUIVALENCY, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 200, 0 }, STR_CUSTOM_CURRENCY_EQUIVALENCY, ft, { colours[1] }); screenCoords.y += 20; - DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_SYMBOL_TEXT, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_SYMBOL_TEXT, {}, { colours[1] }); screenCoords = windowPos + ScreenCoordsXY{ window_custom_currency_widgets[WIDX_SYMBOL_TEXT].left + 1, window_custom_currency_widgets[WIDX_SYMBOL_TEXT].top }; - GfxDrawString(&dpi, screenCoords, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, { colours[1] }); + GfxDrawString(dpi, screenCoords, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, { colours[1] }); auto drawPos = windowPos + ScreenCoordsXY{ window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1, @@ -216,7 +216,7 @@ public: StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) ? STR_PREFIX : STR_SUFFIX; - DrawTextBasic(&dpi, drawPos, stringId, {}, { colours[1] }); + DrawTextBasic(dpi, drawPos, stringId, {}, { colours[1] }); } }; diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 39948972e4..84f196ed5c 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -87,7 +87,7 @@ public: ft.Add(_demolishRideCost); ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3); - DrawTextWrapped(&dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); + DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); } } }; diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index e5fbf93254..d0859d8c00 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -204,7 +204,7 @@ public: // Draw item string Formatter ft(reinterpret_cast(&gDropdownItems[i].Args)); - DrawTextEllipsised(&dpi, screenCoords, width - 5, item, ft, { colour }); + DrawTextEllipsised(dpi, screenCoords, width - 5, item, ft, { colour }); } } } diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 757ab6c65b..28967c8633 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -312,8 +312,8 @@ private: if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) stringId = STR_EDITOR_STEP_OBJECT_SELECTION; - DrawTextBasic(&dpi, { textX, textY }, STR_BACK_TO_PREVIOUS_STEP, {}, { textColour, TextAlignment::CENTRE }); - DrawTextBasic(&dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); + DrawTextBasic(dpi, { textX, textY }, STR_BACK_TO_PREVIOUS_STEP, {}, { textColour, TextAlignment::CENTRE }); + DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); } void DrawRightButtonBack(DrawPixelInfo& dpi) @@ -350,8 +350,8 @@ private: if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) stringId = STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER; - DrawTextBasic(&dpi, { textX, textY }, STR_FORWARD_TO_NEXT_STEP, {}, { textColour, TextAlignment::CENTRE }); - DrawTextBasic(&dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); + DrawTextBasic(dpi, { textX, textY }, STR_FORWARD_TO_NEXT_STEP, {}, { textColour, TextAlignment::CENTRE }); + DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); } void DrawStepText(DrawPixelInfo& dpi) @@ -359,7 +359,7 @@ private: int16_t stateX = (widgets[WIDX_PREVIOUS_IMAGE].right + widgets[WIDX_NEXT_IMAGE].left) / 2 + windowPos.x; int16_t stateY = height - 0x0C + windowPos.y; DrawTextBasic( - &dpi, { stateX, stateY }, _editorStepNames[EnumValue(gEditorStep)], {}, + dpi, { stateX, stateY }, _editorStepNames[EnumValue(gEditorStep)], {}, { static_cast(NOT_TRANSLUCENT(colours[2]) | COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE }); } diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index cccc9fd226..7c9e6c8c04 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -111,20 +111,20 @@ static void DrawResearchItem( // Draw group name auto ft = Formatter(); ft.Add(rideTypeName); - DrawTextEllipsised(&dpi, screenCoords, columnSplitOffset - 11, format, ft, textPaint); + DrawTextEllipsised(dpi, screenCoords, columnSplitOffset - 11, format, ft, textPaint); // Draw vehicle name ft = Formatter(); ft.Add(itemNameId); DrawTextEllipsised( - &dpi, { screenCoords + ScreenCoordsXY{ columnSplitOffset, 0 } }, columnSplitOffset - 11, format, ft, textPaint); + dpi, { screenCoords + ScreenCoordsXY{ columnSplitOffset, 0 } }, columnSplitOffset - 11, format, ft, textPaint); } else { // Scenery group, flat ride or shopdis auto ft = Formatter(); ft.Add(itemNameId); - DrawTextEllipsised(&dpi, screenCoords, width, format, ft, textPaint); + DrawTextEllipsised(dpi, screenCoords, width, format, ft, textPaint); } } @@ -357,12 +357,12 @@ public: // Pre-researched items label screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_PRE_RESEARCHED_SCROLL].left, widgets[WIDX_PRE_RESEARCHED_SCROLL].top - 11 }; - DrawTextBasic(&dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_PREINVENTED_ITEMS); + DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_PREINVENTED_ITEMS); // Research order label screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_RESEARCH_ORDER_SCROLL].left, widgets[WIDX_RESEARCH_ORDER_SCROLL].top - 11 }; - DrawTextBasic(&dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_TO_BE_INVENTED_ITEMS); + DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_TO_BE_INVENTED_ITEMS); // Preview background auto& bkWidget = widgets[WIDX_PREVIEW]; @@ -424,14 +424,14 @@ public: ft.Add(stringId); } - DrawTextEllipsised(&dpi, screenPos, itemWidth, drawString, ft, { TextAlignment::CENTRE }); + DrawTextEllipsised(dpi, screenPos, itemWidth, drawString, ft, { TextAlignment::CENTRE }); screenPos.y += 15; // Item category screenPos.x = windowPos.x + widgets[WIDX_RESEARCH_ORDER_SCROLL].right + 4; ft = Formatter(); ft.Add(researchItem->GetCategoryInventionString()); - DrawTextBasic(&dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft); + DrawTextBasic(dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft); } void OnPrepareDraw() override diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 6ab2c72847..ca438f5a18 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -726,7 +726,7 @@ public: colour2 |= COLOUR_FLAG_INSET; GfxDrawString( - &dpi, screenCoords, static_cast(CheckBoxMarkString), + dpi, screenCoords, static_cast(CheckBoxMarkString), { static_cast(colour2), FontStyle::Medium, darkness }); } @@ -754,7 +754,7 @@ public: auto ft = Formatter(); ft.Add(gCommonStringFormatBuffer); DrawTextEllipsised( - &dpi, screenCoords, width_limit - 15, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); + dpi, screenCoords, width_limit - 15, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); screenCoords.x = widgets[WIDX_LIST_SORT_RIDE].left - widgets[WIDX_LIST].left; } @@ -769,7 +769,7 @@ public: } auto ft = Formatter(); ft.Add(gCommonStringFormatBuffer); - DrawTextEllipsised(&dpi, screenCoords, width_limit, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); + DrawTextEllipsised(dpi, screenCoords, width_limit, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); } screenCoords.y += SCROLLABLE_ROW_HEIGHT; } @@ -1019,7 +1019,7 @@ public: auto ft = Formatter(); ft.Add(numSelected); ft.Add(totalSelectable); - DrawTextBasic(&dpi, screenPos, STR_OBJECT_SELECTION_SELECTION_SIZE, ft); + DrawTextBasic(dpi, screenPos, STR_OBJECT_SELECTION_SELECTION_SIZE, ft); } // Draw sort button text @@ -1031,7 +1031,7 @@ public: : STR_NONE; ft.Add(stringId); auto screenPos = windowPos + ScreenCoordsXY{ listSortTypeWidget.left + 1, listSortTypeWidget.top + 1 }; - DrawTextEllipsised(&dpi, screenPos, listSortTypeWidget.width(), STR_OBJECTS_SORT_TYPE, ft, { colours[1] }); + DrawTextEllipsised(dpi, screenPos, listSortTypeWidget.width(), STR_OBJECTS_SORT_TYPE, ft, { colours[1] }); } const auto& listSortRideWidget = widgets[WIDX_LIST_SORT_RIDE]; if (listSortRideWidget.type != WindowWidgetType::Empty) @@ -1041,7 +1041,7 @@ public: : STR_NONE; ft.Add(stringId); auto screenPos = windowPos + ScreenCoordsXY{ listSortRideWidget.left + 1, listSortRideWidget.top + 1 }; - DrawTextEllipsised(&dpi, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { colours[1] }); + DrawTextEllipsised(dpi, screenPos, listSortRideWidget.width(), STR_OBJECTS_SORT_RIDE, ft, { colours[1] }); } if (selected_list_item == -1 || _loadedObject == nullptr) @@ -1068,7 +1068,7 @@ public: auto ft = Formatter(); ft.Add(STR_STRING); ft.Add(listItem->repositoryItem->Name.c_str()); - DrawTextEllipsised(&dpi, screenPos, _width, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); + DrawTextEllipsised(dpi, screenPos, _width, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); } DrawDescriptions(&dpi); @@ -1195,7 +1195,7 @@ private: ft.Add(STR_STRING); ft.Add(description.c_str()); - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + LIST_ROW_HEIGHT; + screenPos.y += DrawTextWrapped(*dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + LIST_ROW_HEIGHT; } if (GetSelectedObjectType() == ObjectType::Ride) { @@ -1216,7 +1216,7 @@ private: } auto ft = Formatter(); ft.Add(sells.c_str()); - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_RIDE_OBJECT_SHOP_SELLS, ft) + 2; + screenPos.y += DrawTextWrapped(*dpi, screenPos, _width2, STR_RIDE_OBJECT_SHOP_SELLS, ft) + 2; } } else if (GetSelectedObjectType() == ObjectType::SceneryGroup) @@ -1224,11 +1224,11 @@ private: const auto* sceneryGroupObject = reinterpret_cast(_loadedObject.get()); auto ft = Formatter(); ft.Add(sceneryGroupObject->GetNumIncludedObjects()); - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_INCLUDES_X_OBJECTS, ft) + 2; + screenPos.y += DrawTextWrapped(*dpi, screenPos, _width2, STR_INCLUDES_X_OBJECTS, ft) + 2; } else if (GetSelectedObjectType() == ObjectType::Music) { - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_MUSIC_OBJECT_TRACK_HEADER) + 2; + screenPos.y += DrawTextWrapped(*dpi, screenPos, _width2, STR_MUSIC_OBJECT_TRACK_HEADER) + 2; const auto* musicObject = reinterpret_cast(_loadedObject.get()); for (size_t i = 0; i < musicObject->GetTrackCount(); i++) { @@ -1241,7 +1241,7 @@ private: auto ft = Formatter(); ft.Add(track->Name.c_str()); ft.Add(track->Composer.c_str()); - screenPos.y += DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 10, 0 }, _width2, stringId, ft); + screenPos.y += DrawTextWrapped(*dpi, screenPos + ScreenCoordsXY{ 10, 0 }, _width2, stringId, ft); } } } @@ -1254,7 +1254,7 @@ private: // Draw fallback image warning if (_loadedObject && _loadedObject->UsesFallbackImages()) { - DrawTextBasic(dpi, screenPos, STR_OBJECT_USES_FALLBACK_IMAGES, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); + DrawTextBasic(*dpi, screenPos, STR_OBJECT_USES_FALLBACK_IMAGES, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); } screenPos.y += LIST_ROW_HEIGHT; @@ -1262,14 +1262,14 @@ private: if (GetSelectedObjectType() == ObjectType::Ride) { auto stringId = GetRideTypeStringId(listItem->repositoryItem); - DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); + DrawTextBasic(*dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); } screenPos.y += LIST_ROW_HEIGHT; // Draw object source auto stringId = ObjectManagerGetSourceGameString(listItem->repositoryItem->GetFirstSourceGame()); - DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); + DrawTextBasic(*dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); screenPos.y += LIST_ROW_HEIGHT; // Draw object filename @@ -1279,7 +1279,7 @@ private: ft.Add(STR_STRING); ft.Add(path.c_str()); DrawTextBasic( - dpi, { windowPos.x + this->width - 5, screenPos.y }, STR_WINDOW_COLOUR_2_STRINGID, ft, + *dpi, { windowPos.x + this->width - 5, screenPos.y }, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_BLACK, TextAlignment::RIGHT }); screenPos.y += LIST_ROW_HEIGHT; } @@ -1299,7 +1299,7 @@ private: ft.Add(STR_STRING); ft.Add(authorsString.c_str()); DrawTextEllipsised( - dpi, { windowPos.x + width - 5, screenPos.y }, width - widgets[WIDX_LIST].right - 4, + *dpi, { windowPos.x + width - 5, screenPos.y }, width - widgets[WIDX_LIST].right - 4, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::RIGHT }); } } diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index c10fab1c77..bda024ad33 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -773,13 +773,13 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo* // Objective label auto screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_OBJECTIVE].top }; - DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_WINDOW); + DrawTextBasic(*dpi, screenCoords, STR_OBJECTIVE_WINDOW); // Objective value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE].left + 1, w->widgets[WIDX_OBJECTIVE].top }; auto ft = Formatter(); ft.Add(ObjectiveDropdownOptionNames[gScenarioObjective.Type]); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); + DrawTextBasic(*dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); if (w->widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty) { @@ -808,7 +808,7 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo* stringId = STR_WINDOW_OBJECTIVE_EXCITEMENT_RATING; break; } - DrawTextBasic(dpi, screenCoords, stringId); + DrawTextBasic(*dpi, screenCoords, stringId); // Objective argument 1 value screenCoords = w->windowPos @@ -841,21 +841,21 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo* ft.Add(gScenarioObjective.Currency); break; } - DrawTextBasic(dpi, screenCoords, stringId, ft, COLOUR_BLACK); + DrawTextBasic(*dpi, screenCoords, stringId, ft, COLOUR_BLACK); } if (w->widgets[WIDX_OBJECTIVE_ARG_2].type != WindowWidgetType::Empty) { // Objective argument 2 label screenCoords = w->windowPos + ScreenCoordsXY{ 28, w->widgets[WIDX_OBJECTIVE_ARG_2].top }; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_DATE); + DrawTextBasic(*dpi, screenCoords, STR_WINDOW_OBJECTIVE_DATE); // Objective argument 2 value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_OBJECTIVE_ARG_2].left + 1, w->widgets[WIDX_OBJECTIVE_ARG_2].top }; ft = Formatter(); ft.Add((gScenarioObjective.Year * MONTH_COUNT) - 1); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft); + DrawTextBasic(*dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft); } // Park name @@ -869,7 +869,7 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo* ft = Formatter(); ft.Add(STR_STRING); ft.Add(parkName); - DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft); + DrawTextEllipsised(*dpi, screenCoords, width, STR_WINDOW_PARK_NAME, ft); } // Scenario name @@ -879,11 +879,11 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo* ft = Formatter(); ft.Add(STR_STRING); ft.Add(gScenarioName.c_str()); - DrawTextEllipsised(dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft); + DrawTextEllipsised(*dpi, screenCoords, width, STR_WINDOW_SCENARIO_NAME, ft); // Scenario details label screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_DETAILS].top }; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_PARK_DETAILS); + DrawTextBasic(*dpi, screenCoords, STR_WINDOW_PARK_DETAILS); // Scenario details value screenCoords = w->windowPos + ScreenCoordsXY{ 16, w->widgets[WIDX_DETAILS].top + 10 }; @@ -892,17 +892,17 @@ static void WindowEditorObjectiveOptionsMainPaint(WindowBase* w, DrawPixelInfo* ft = Formatter(); ft.Add(STR_STRING); ft.Add(gScenarioDetails.c_str()); - DrawTextWrapped(dpi, screenCoords, width, STR_BLACK_STRING, ft); + DrawTextWrapped(*dpi, screenCoords, width, STR_BLACK_STRING, ft); // Scenario category label screenCoords = w->windowPos + ScreenCoordsXY{ 8, w->widgets[WIDX_CATEGORY].top }; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_SCENARIO_GROUP); + DrawTextBasic(*dpi, screenCoords, STR_WINDOW_SCENARIO_GROUP); // Scenario category value screenCoords = w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_CATEGORY].left + 1, w->widgets[WIDX_CATEGORY].top }; ft = Formatter(); ft.Add(ScenarioCategoryStringIds[gScenarioCategory]); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); + DrawTextBasic(*dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } /** @@ -1044,7 +1044,7 @@ static void WindowEditorObjectiveOptionsRidesPaint(WindowBase* w, DrawPixelInfo* WindowEditorObjectiveOptionsDrawTabImages(w, dpi); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PAGE_BACKGROUND].top + 3 }, STR_WINDOW_PRESERVATION_ORDER); + *dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PAGE_BACKGROUND].top + 3 }, STR_WINDOW_PRESERVATION_ORDER); } /** @@ -1083,7 +1083,7 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(WindowBase* w, DrawPixe { auto darkness = stringId == STR_WINDOW_COLOUR_2_STRINGID ? TextDarkness::ExtraDark : TextDarkness::Dark; GfxDrawString( - dpi, { 2, y }, static_cast(CheckBoxMarkString), + *dpi, { 2, y }, static_cast(CheckBoxMarkString), { static_cast(w->colours[1] & 0x7F), FontStyle::Medium, darkness }); } @@ -1091,7 +1091,7 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(WindowBase* w, DrawPixe Formatter ft; ride->FormatNameTo(ft); - DrawTextBasic(dpi, { 15, y }, stringId, ft); + DrawTextBasic(*dpi, { 15, y }, stringId, ft); } } } diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index d7c94ef098..94e4459b4e 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -620,49 +620,49 @@ private: if (initialCashWidget.type != WindowWidgetType::Empty) { screenCoords = windowPos + ScreenCoordsXY{ 8, initialCashWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_INIT_CASH_LABEL); + DrawTextBasic(dpi, screenCoords, STR_INIT_CASH_LABEL); screenCoords = windowPos + ScreenCoordsXY{ initialCashWidget.left + 1, initialCashWidget.top }; auto ft = Formatter(); ft.Add(gInitialCash); - DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } const auto& initialLoanWidget = widgets[WIDX_INITIAL_LOAN]; if (initialLoanWidget.type != WindowWidgetType::Empty) { screenCoords = windowPos + ScreenCoordsXY{ 8, initialLoanWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_INIT_LOAN_LABEL); + DrawTextBasic(dpi, screenCoords, STR_INIT_LOAN_LABEL); screenCoords = windowPos + ScreenCoordsXY{ initialLoanWidget.left + 1, initialLoanWidget.top }; auto ft = Formatter(); ft.Add(gBankLoan); - DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } const auto& maximumLoanWidget = widgets[WIDX_MAXIMUM_LOAN]; if (maximumLoanWidget.type != WindowWidgetType::Empty) { screenCoords = windowPos + ScreenCoordsXY{ 8, maximumLoanWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_MAX_LOAN_LABEL); + DrawTextBasic(dpi, screenCoords, STR_MAX_LOAN_LABEL); screenCoords = windowPos + ScreenCoordsXY{ maximumLoanWidget.left + 1, maximumLoanWidget.top }; auto ft = Formatter(); ft.Add(gMaxBankLoan); - DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } const auto& interestRateWidget = widgets[WIDX_INTEREST_RATE]; if (interestRateWidget.type != WindowWidgetType::Empty) { screenCoords = windowPos + ScreenCoordsXY{ 8, interestRateWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_INTEREST_RATE_LABEL); + DrawTextBasic(dpi, screenCoords, STR_INTEREST_RATE_LABEL); screenCoords = windowPos + ScreenCoordsXY{ interestRateWidget.left + 1, interestRateWidget.top }; auto ft = Formatter(); ft.Add(std::clamp(static_cast(gBankLoanInterestRate), INT16_MIN, INT16_MAX)); - DrawTextBasic(&dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); } } @@ -869,47 +869,47 @@ private: { // Cash per guest label screenCoords = windowPos + ScreenCoordsXY{ 8, cashPerGuestWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_CASH_PER_GUEST_LABEL); + DrawTextBasic(dpi, screenCoords, STR_CASH_PER_GUEST_LABEL); // Cash per guest value screenCoords = windowPos + ScreenCoordsXY{ cashPerGuestWidget.left + 1, cashPerGuestWidget.top }; auto ft = Formatter(); ft.Add(gGuestInitialCash); - DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } // Guest initial happiness label const auto& initialHappinessWidget = widgets[WIDX_GUEST_INITIAL_HAPPINESS]; screenCoords = windowPos + ScreenCoordsXY{ 8, initialHappinessWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_INIT_HAPPINESS); + DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HAPPINESS); // Guest initial happiness value screenCoords = windowPos + ScreenCoordsXY{ initialHappinessWidget.left + 1, initialHappinessWidget.top }; auto ft = Formatter(); ft.Add((gGuestInitialHappiness * 100) / 255); - DrawTextBasic(&dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); // Guest initial hunger label const auto& initialHungerWidget = widgets[WIDX_GUEST_INITIAL_HUNGER]; screenCoords = windowPos + ScreenCoordsXY{ 8, initialHungerWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_INIT_HUNGER); + DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HUNGER); // Guest initial hunger value screenCoords = windowPos + ScreenCoordsXY{ initialHungerWidget.left + 1, initialHungerWidget.top }; ft = Formatter(); ft.Add(((255 - gGuestInitialHunger) * 100) / 255); - DrawTextBasic(&dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); // Guest initial thirst label const auto& initialThirstWidget = widgets[WIDX_GUEST_INITIAL_THIRST]; screenCoords = windowPos + ScreenCoordsXY{ 8, initialThirstWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_INIT_THIRST); + DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_THIRST); // Guest initial thirst value screenCoords = windowPos + ScreenCoordsXY{ initialThirstWidget.left + 1, initialThirstWidget.top }; ft = Formatter(); ft.Add(((255 - gGuestInitialThirst) * 100) / 255); - DrawTextBasic(&dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); } #pragma endregion @@ -1188,13 +1188,13 @@ private: { // Cost to buy land label screenCoords = windowPos + ScreenCoordsXY{ 8, landCostWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_LAND_COST_LABEL); + DrawTextBasic(dpi, screenCoords, STR_LAND_COST_LABEL); // Cost to buy land value screenCoords = windowPos + ScreenCoordsXY{ landCostWidget.left + 1, landCostWidget.top }; auto ft = Formatter(); ft.Add(gLandPrice); - DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } const auto& constructionRightsCostWidget = widgets[WIDX_CONSTRUCTION_RIGHTS_COST]; @@ -1202,14 +1202,14 @@ private: { // Cost to buy construction rights label screenCoords = windowPos + ScreenCoordsXY{ 8, constructionRightsCostWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_RIGHTS_COST_LABEL); + DrawTextBasic(dpi, screenCoords, STR_RIGHTS_COST_LABEL); // Cost to buy construction rights value screenCoords = windowPos + ScreenCoordsXY{ constructionRightsCostWidget.left + 1, constructionRightsCostWidget.top }; auto ft = Formatter(); ft.Add(gConstructionRightsPrice); - DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } const auto& payForParkOrRidesWidget = widgets[WIDX_PAY_FOR_PARK_OR_RIDES]; @@ -1227,7 +1227,7 @@ private: else ft.Add(STR_PAY_PARK_ENTER); - DrawTextBasic(&dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } const auto& entryPriceWidget = widgets[WIDX_ENTRY_PRICE]; @@ -1235,25 +1235,25 @@ private: { // Entry price label screenCoords = windowPos + ScreenCoordsXY{ payForParkOrRidesWidget.right + 8, entryPriceWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_ENTRY_PRICE_LABEL); + DrawTextBasic(dpi, screenCoords, STR_ENTRY_PRICE_LABEL); // Entry price value screenCoords = windowPos + ScreenCoordsXY{ entryPriceWidget.left + 1, entryPriceWidget.top }; auto ft = Formatter(); ft.Add(gParkEntranceFee); - DrawTextBasic(&dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } // Climate label const auto& climateWidget = widgets[WIDX_CLIMATE]; screenCoords = windowPos + ScreenCoordsXY{ 8, climateWidget.top }; - DrawTextBasic(&dpi, screenCoords, STR_CLIMATE_LABEL); + DrawTextBasic(dpi, screenCoords, STR_CLIMATE_LABEL); // Climate value screenCoords = windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top }; auto ft = Formatter(); ft.Add(ClimateNames[static_cast(gClimate)]); - DrawTextBasic(&dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } #pragma endregion diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index ccf30e943b..c92be3b339 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -94,7 +94,7 @@ public: FilterPaletteID::PaletteDarken3); DrawStringCentredRaw( - &dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium); + dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium); } void OnUnknown5() override diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 7a74041e5b..7818028718 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -393,7 +393,7 @@ public: ft.Add(STR_FINANCES_SUMMARY_MONTH_HEADING); ft.Add(monthyear); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, + dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, monthyear == currentMonthYear ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING, ft, { TextUnderline::On, TextAlignment::RIGHT }); screenCoords.y += 14; @@ -411,7 +411,7 @@ public: ft = Formatter(); ft.Add(expenditure); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, + dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT }); } screenCoords.y += TABLE_CELL_HEIGHT; @@ -423,7 +423,7 @@ public: ft = Formatter(); ft.Add(profit); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT }); + dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT }); GfxFillRect( &dpi, @@ -532,7 +532,7 @@ public: // Expenditure / Income heading DrawTextBasic( - &dpi, screenCoords, STR_FINANCES_SUMMARY_EXPENDITURE_INCOME, {}, + dpi, screenCoords, STR_FINANCES_SUMMARY_EXPENDITURE_INCOME, {}, { COLOUR_BLACK, TextUnderline::On, TextAlignment::LEFT }); screenCoords.y += 14; @@ -546,7 +546,7 @@ public: { screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (TABLE_CELL_HEIGHT - 2) } }, ColourMapA[colours[1]].lighter | 0x1000000); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, _windowFinancesSummaryRowLabels[i]); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, _windowFinancesSummaryRowLabels[i]); screenCoords.y += TABLE_CELL_HEIGHT; } @@ -556,19 +556,19 @@ public: INSET_RECT_FLAG_BORDER_INSET); // Loan and interest rate - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 8, 279 }, STR_FINANCES_SUMMARY_LOAN); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, 279 }, STR_FINANCES_SUMMARY_LOAN); if (!(gParkFlags & PARK_FLAGS_RCT1_INTEREST)) { auto ft = Formatter(); ft.Add(gBankLoanInterestRate); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft); } // Current cash auto ft = Formatter(); ft.Add(gCash); StringId stringId = gCash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL; - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft); // Objective related financial information if (gScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME) @@ -577,18 +577,17 @@ public: ft = Formatter(); ft.Add(lastMonthProfit); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL, - ft); + dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL, ft); } else { // Park value and company value ft = Formatter(); ft.Add(gParkValue); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, ft); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, ft); ft = Formatter(); ft.Add(gCompanyValue); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, ft); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, ft); } } @@ -613,7 +612,7 @@ public: ft.Add(cashLessLoan); DrawTextBasic( - &dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, + dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, cashLessLoan >= 0 ? STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE : STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE, ft); @@ -647,7 +646,7 @@ public: ft = Formatter(); ft.Add(axisValue); DrawTextBasic( - &dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, + dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontStyle::Small, TextAlignment::RIGHT }); GfxFillRectInset( &dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2], @@ -673,7 +672,7 @@ public: // Park value auto ft = Formatter(); ft.Add(gParkValue); - DrawTextBasic(&dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft); + DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft); // Graph GfxFillRectInset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30); @@ -704,7 +703,7 @@ public: ft = Formatter(); ft.Add(axisValue); DrawTextBasic( - &dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, + dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontStyle::Small, TextAlignment::RIGHT }); GfxFillRectInset( &dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2], @@ -731,7 +730,7 @@ public: auto ft = Formatter(); ft.Add(gCurrentProfit); DrawTextBasic( - &dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, + dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, gCurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft); // Graph @@ -763,7 +762,7 @@ public: ft = Formatter(); ft.Add(axisValue); DrawTextBasic( - &dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, + dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, { FontStyle::Small, TextAlignment::RIGHT }); GfxFillRectInset( &dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2], @@ -860,14 +859,14 @@ public: } } // Advertisement - DrawTextEllipsised(&dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, 296, MarketingCampaignNames[i][1], ft); + DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, 296, MarketingCampaignNames[i][1], ft); // Duration uint16_t weeksRemaining = marketingCampaign->WeeksLeft; ft = Formatter(); ft.Add(weeksRemaining); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 304, 0 }, + dpi, screenCoords + ScreenCoordsXY{ 304, 0 }, weeksRemaining == 1 ? STR_1_WEEK_REMAINING : STR_X_WEEKS_REMAINING, ft); screenCoords.y += LIST_ROW_HEIGHT; @@ -875,7 +874,7 @@ public: if (noCampaignsActive) { - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, STR_MARKETING_CAMPAIGNS_NONE); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, STR_MARKETING_CAMPAIGNS_NONE); screenCoords.y += LIST_ROW_HEIGHT; } screenCoords.y += 34; @@ -887,10 +886,10 @@ public: if (campaignButton->type != WindowWidgetType::Empty) { // Draw button text - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]); auto ft = Formatter(); ft.Add(AdvertisingCampaignPricePerWeek[i]); - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, ft); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, ft); screenCoords.y += BUTTON_FACE_HEIGHT + 2; } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 7df93b085b..f63d68eaca 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -489,7 +489,7 @@ public: screenCoords = this->windowPos + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), window_footpath_widgets[WIDX_CONSTRUCT].bottom - 23 }; - DrawTextBasic(&dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); } // Draw cost @@ -502,7 +502,7 @@ public: { auto ft = Formatter(); ft.Add(_windowFootpathCost); - DrawTextBasic(&dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 88678d0f43..c036abf6e4 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -412,7 +412,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo* dpi, WindowBase* StringId stringId = gCash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH; auto ft = Formatter(); ft.Add(gCash); - DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); + DrawTextBasic(*dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); } static constexpr const StringId _guestCountFormats[] = { @@ -440,7 +440,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo* dpi, WindowBase* : NOT_TRANSLUCENT(w->colours[0])); auto ft = Formatter(); ft.Add(gNumGuestsInPark); - DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); + DrawTextBasic(*dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); } // Draw park rating @@ -509,7 +509,7 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase ft.Add(DateDayNames[day]); ft.Add(month); ft.Add(year); - DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); + DrawTextBasic(*dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); // Figure out how much line height we have to work with. uint32_t line_height = FontGetLineHeight(FontStyle::Medium); @@ -527,7 +527,7 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase } ft = Formatter(); ft.Add(temperature); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 0, 6 }, format, ft); + DrawTextBasic(*dpi, screenCoords + ScreenCoordsXY{ 0, 6 }, format, ft); screenCoords.x += 30; // Current weather @@ -570,7 +570,7 @@ static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo* dpi, WindowBase* auto screenCoords = w->windowPos + ScreenCoordsXY{ middleOutsetWidget->midX(), middleOutsetWidget->top + 11 }; width = middleOutsetWidget->width() - 62; DrawNewsTicker( - dpi, screenCoords, width, COLOUR_BRIGHT_GREEN, STR_BOTTOM_TOOLBAR_NEWS_TEXT, newsItem->Text, newsItem->Ticks); + *dpi, screenCoords, width, COLOUR_BRIGHT_GREEN, STR_BOTTOM_TOOLBAR_NEWS_TEXT, newsItem->Text, newsItem->Ticks); screenCoords = w->windowPos + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].left, @@ -675,12 +675,12 @@ static void WindowGameBottomToolbarDrawMiddlePanel(DrawPixelInfo* dpi, WindowBas if (stringId == STR_NONE) { DrawTextWrapped( - dpi, middleWidgetCoords, width, STR_TITLE_SEQUENCE_OPENRCT2, ft, { w->colours[0], TextAlignment::CENTRE }); + *dpi, middleWidgetCoords, width, STR_TITLE_SEQUENCE_OPENRCT2, ft, { w->colours[0], TextAlignment::CENTRE }); } else { // Show tooltip in bottom toolbar - DrawTextWrapped(dpi, middleWidgetCoords, width, STR_STRINGID, ft, { w->colours[0], TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, middleWidgetCoords, width, STR_STRINGID, ft, { w->colours[0], TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 769bb12c0e..df87dc5461 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -773,7 +773,7 @@ private: auto ft = Formatter(); peep->FormatActionTo(ft); int32_t textWidth = actionLabelWidget.width(); - DrawTextEllipsised(&dpi, screenPos, textWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); + DrawTextEllipsised(dpi, screenPos, textWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); } // Draw the marquee thought @@ -811,7 +811,7 @@ private: { auto ft = Formatter(); PeepThoughtSetFormatArgs(&peep->Thoughts[i], ft); - DrawTextBasic(&dpiMarquee, { screenPos.x, 0 }, STR_WINDOW_COLOUR_2_STRINGID, ft, { FontStyle::Small }); + DrawTextBasic(dpiMarquee, { screenPos.x, 0 }, STR_WINDOW_COLOUR_2_STRINGID, ft, { FontStyle::Small }); } } @@ -1090,7 +1090,7 @@ private: + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; // Happiness - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_HAPPINESS_LABEL); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HAPPINESS_LABEL); int32_t happiness = NormalizeGuestStatValue(peep->Happiness, PEEP_MAX_HAPPINESS, 10); int32_t barColour = COLOUR_BRIGHT_GREEN; @@ -1099,7 +1099,7 @@ private: // Energy screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_ENERGY_LABEL); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_ENERGY_LABEL); int32_t energy = NormalizeGuestStatValue(peep->Energy - PEEP_MIN_ENERGY, PEEP_MAX_ENERGY - PEEP_MIN_ENERGY, 10); barColour = COLOUR_BRIGHT_GREEN; @@ -1108,7 +1108,7 @@ private: // Hunger screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_HUNGER_LABEL); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HUNGER_LABEL); int32_t hunger = NormalizeGuestStatValue(peep->Hunger - 32, 158, 0); hunger = 255 - hunger; // the bar should be longer when peep->Hunger is low @@ -1118,7 +1118,7 @@ private: // Thirst screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_THIRST_LABEL); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_THIRST_LABEL); int32_t thirst = NormalizeGuestStatValue(peep->Thirst - 32, 158, 0); thirst = 255 - thirst; // the bar should be longer when peep->Thirst is low @@ -1128,7 +1128,7 @@ private: // Nausea screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_NAUSEA_LABEL); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_LABEL); int32_t nausea = NormalizeGuestStatValue(peep->Nausea - 32, 223, 0); barColour = COLOUR_BRIGHT_RED; @@ -1137,7 +1137,7 @@ private: // Toilet screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_TOILET_LABEL); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TOILET_LABEL); int32_t toilet = NormalizeGuestStatValue(peep->Toilet - 64, 178, 0); barColour = COLOUR_BRIGHT_RED; @@ -1152,7 +1152,7 @@ private: int32_t timeInPark = (gCurrentTicks - guestEntryTime) >> 11; auto ft = Formatter(); ft.Add(timeInPark & 0xFFFF); - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft); } screenCoords.y += LIST_ROW_HEIGHT + 9; @@ -1161,7 +1161,7 @@ private: INSET_RECT_FLAG_BORDER_INSET); // Preferred Ride - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_PREFERRED_RIDE); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_PREFERRED_RIDE); screenCoords.y += LIST_ROW_HEIGHT; // Intensity @@ -1182,7 +1182,7 @@ private: ft.Add(maxIntensity); } - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, string_id, ft); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, string_id, ft); } // Nausea tolerance @@ -1197,7 +1197,7 @@ private: auto nausea_tolerance = EnumValue(peep->NauseaTolerance) & 0x3; auto ft = Formatter(); ft.Add(_nauseaTolerances[nausea_tolerance]); - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_NAUSEA_TOLERANCE, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_TOLERANCE, ft); } } @@ -1333,7 +1333,7 @@ private: auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 2, widgets[WIDX_PAGE_BACKGROUND].top + 2 }; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_LABEL_RIDES_BEEN_ON); + DrawTextBasic(dpi, screenCoords, STR_GUEST_LABEL_RIDES_BEEN_ON); screenCoords.y = windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 12; @@ -1348,7 +1348,7 @@ private: ft.Add(STR_PEEP_FAVOURITE_RIDE_NOT_AVAILABLE); } - DrawTextEllipsised(&dpi, screenCoords, width - 14, STR_FAVOURITE_RIDE, ft); + DrawTextEllipsised(dpi, screenCoords, width - 14, STR_FAVOURITE_RIDE, ft); } void OnScrollDrawRides(int32_t scrollIndex, DrawPixelInfo& dpi) @@ -1372,7 +1372,7 @@ private: { auto ft = Formatter(); r->FormatNameTo(ft); - DrawTextBasic(&dpi, { 0, y - 1 }, stringId, ft); + DrawTextBasic(dpi, { 0, y - 1 }, stringId, ft); } } } @@ -1430,7 +1430,7 @@ private: { auto ft = Formatter(); ft.Add(peep->CashInPocket); - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_CASH_IN_POCKET, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_IN_POCKET, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -1438,7 +1438,7 @@ private: { auto ft = Formatter(); ft.Add(peep->CashSpent); - DrawTextBasic(&dpi, screenCoords, STR_GUEST_STAT_CASH_SPENT, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_SPENT, ft); screenCoords.y += LIST_ROW_HEIGHT * 2; } @@ -1450,7 +1450,7 @@ private: { auto ft = Formatter(); ft.Add(peep->PaidToEnter); - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_ENTRANCE_FEE, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_ENTRANCE_FEE, ft); screenCoords.y += LIST_ROW_HEIGHT; } // Paid on rides @@ -1460,11 +1460,11 @@ private: ft.Add(peep->GuestNumRides); if (peep->GuestNumRides != 1) { - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_RIDE_PLURAL, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE_PLURAL, ft); } else { - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_RIDE, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE, ft); } screenCoords.y += LIST_ROW_HEIGHT; } @@ -1475,11 +1475,11 @@ private: ft.Add(peep->AmountOfFood); if (peep->AmountOfFood != 1) { - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_FOOD_PLURAL, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD_PLURAL, ft); } else { - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_FOOD, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD, ft); } screenCoords.y += LIST_ROW_HEIGHT; } @@ -1491,11 +1491,11 @@ private: ft.Add(peep->AmountOfDrinks); if (peep->AmountOfDrinks != 1) { - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_DRINK_PLURAL, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK_PLURAL, ft); } else { - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_DRINK, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK, ft); } screenCoords.y += LIST_ROW_HEIGHT; } @@ -1506,11 +1506,11 @@ private: ft.Add(peep->AmountOfSouvenirs); if (peep->AmountOfSouvenirs != 1) { - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR_PLURAL, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR_PLURAL, ft); } else { - DrawTextBasic(&dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR, ft); } } } @@ -1575,7 +1575,7 @@ private: auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - DrawTextBasic(&dpi, screenCoords, STR_GUEST_RECENT_THOUGHTS_LABEL); + DrawTextBasic(dpi, screenCoords, STR_GUEST_RECENT_THOUGHTS_LABEL); screenCoords.y += 10; for (const auto& thought : peep->Thoughts) @@ -1589,7 +1589,7 @@ private: auto ft = Formatter(); PeepThoughtSetFormatArgs(&thought, ft); - screenCoords.y += DrawTextWrapped(&dpi, screenCoords, widgWidth, STR_BLACK_STRING, ft, { FontStyle::Small }); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, widgWidth, STR_BLACK_STRING, ft, { FontStyle::Small }); // If this is the last visible line end drawing. if (screenCoords.y > windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 32) @@ -1765,7 +1765,7 @@ private: int32_t maxY = windowPos.y + height - 22; int32_t numItems = 0; - DrawTextBasic(&dpi, screenCoords, STR_CARRYING); + DrawTextBasic(dpi, screenCoords, STR_CARRYING); screenCoords.y += 10; for (ShopItem item = ShopItem::Balloon; item < ShopItem::Count; item++) @@ -1776,13 +1776,13 @@ private: continue; auto [stringId, ft] = InventoryFormatItem(*guest, item); - screenCoords.y += DrawTextWrapped(&dpi, screenCoords, itemNameWidth, stringId, ft); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, itemNameWidth, stringId, ft); numItems++; } if (numItems == 0) { - DrawTextBasic(&dpi, screenCoords, STR_NOTHING); + DrawTextBasic(dpi, screenCoords, STR_NOTHING); } } #pragma endregion @@ -1835,7 +1835,7 @@ private: { auto ft = Formatter(); ft.Add(peep->Id); - DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_SPRITE_INDEX, ft); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_SPRITE_INDEX, ft); } screenCoords.y += LIST_ROW_HEIGHT; { @@ -1843,7 +1843,7 @@ private: ft.Add(peep->x); ft.Add(peep->y); ft.Add(peep->z); - DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_POSITION, ft); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_POSITION, ft); } screenCoords.y += LIST_ROW_HEIGHT; { @@ -1864,7 +1864,7 @@ private: OpenRCT2::FormatStringLegacy(buffer2, sizeof(buffer2), STR_PEEP_DEBUG_NEXT_SLOPE, ft2.Data()); SafeStrCat(buffer, buffer2, sizeof(buffer)); } - GfxDrawString(&dpi, screenCoords, buffer, {}); + GfxDrawString(dpi, screenCoords, buffer, {}); } screenCoords.y += LIST_ROW_HEIGHT; { @@ -1872,7 +1872,7 @@ private: ft.Add(peep->DestinationX); ft.Add(peep->DestinationY); ft.Add(peep->DestinationTolerance); - DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_DEST, ft); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_DEST, ft); } screenCoords.y += LIST_ROW_HEIGHT; { @@ -1881,10 +1881,10 @@ private: ft.Add(peep->PathfindGoal.y); ft.Add(peep->PathfindGoal.z); ft.Add(peep->PathfindGoal.direction); - DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_GOAL, ft); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_GOAL, ft); } screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY); screenCoords.y += LIST_ROW_HEIGHT; screenCoords.x += 10; @@ -1895,7 +1895,7 @@ private: ft.Add(point.y); ft.Add(point.z); ft.Add(point.direction); - DrawTextBasic(&dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, ft); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, ft); screenCoords.y += LIST_ROW_HEIGHT; } screenCoords.x -= 10; diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index ed02e1b7a5..6a7cea611b 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -473,7 +473,7 @@ public: { Formatter ft(_filterArguments.args); - DrawTextEllipsised(&dpi, screenCoords, 310, format, ft); + DrawTextEllipsised(dpi, screenCoords, 310, format, ft); } // Number of guests (list items) @@ -483,7 +483,7 @@ public: auto ft = Formatter(); ft.Add(static_cast(_guestList.size())); DrawTextBasic( - &dpi, screenCoords, (_guestList.size() == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL), + dpi, screenCoords, (_guestList.size() == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL), ft); } } @@ -681,7 +681,7 @@ private: } auto ft = Formatter(); peep->FormatNameTo(ft); - DrawTextEllipsised(&dpi, { 0, y }, 113, format, ft); + DrawTextEllipsised(dpi, { 0, y }, 113, format, ft); switch (_selectedView) { @@ -696,7 +696,7 @@ private: // Action ft = Formatter(); peep->FormatActionTo(ft); - DrawTextEllipsised(&dpi, { 133, y }, 314, format, ft); + DrawTextEllipsised(dpi, { 133, y }, 314, format, ft); break; case GuestViewType::Thoughts: // For each thought @@ -711,7 +711,7 @@ private: ft = Formatter(); PeepThoughtSetFormatArgs(&thought, ft); - DrawTextEllipsised(&dpi, { 118, y }, 329, format, ft, { FontStyle::Small }); + DrawTextEllipsised(dpi, { 118, y }, 329, format, ft, { FontStyle::Small }); break; } break; @@ -756,18 +756,18 @@ private: // Draw small font if displaying guests if (_selectedView == GuestViewType::Thoughts) { - DrawTextEllipsised(&dpi, { 0, y }, 414, format, ft, { FontStyle::Small }); + DrawTextEllipsised(dpi, { 0, y }, 414, format, ft, { FontStyle::Small }); } else { - DrawTextEllipsised(&dpi, { 0, y }, 414, format, ft); + DrawTextEllipsised(dpi, { 0, y }, 414, format, ft); } // Draw guest count ft = Formatter(); ft.Add(STR_GUESTS_COUNT_COMMA_SEP); ft.Add(group.NumGuests); - DrawTextBasic(&dpi, { 326, y }, format, ft, { TextAlignment::RIGHT }); + DrawTextBasic(dpi, { 326, y }, format, ft, { TextAlignment::RIGHT }); } y += SUMMARISED_GUEST_ROW_HEIGHT; index++; diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 53c5b0cdf3..e7afb69ae3 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -175,7 +175,7 @@ public: { // Scenery not available DrawTextEllipsised( - &dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); + dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); screenPos.y -= LIST_ROW_HEIGHT; } } @@ -189,7 +189,7 @@ public: auto trackName = _trackName.c_str(); auto ft = Formatter(); ft.Add(trackName); - DrawTextBasic(&dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft); + DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -210,7 +210,7 @@ public: ft.Add(GetRideTypeDescriptor(td6->type).Naming.Name); } - DrawTextBasic(&dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft); screenPos.y += LIST_ROW_HEIGHT + 4; } @@ -219,21 +219,21 @@ public: fixed32_2dp rating = td6->excitement * 10; auto ft = Formatter(); ft.Add(rating); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); screenPos.y += LIST_ROW_HEIGHT; } { fixed32_2dp rating = td6->intensity * 10; auto ft = Formatter(); ft.Add(rating); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); screenPos.y += LIST_ROW_HEIGHT; } { fixed32_2dp rating = td6->nausea * 10; auto ft = Formatter(); ft.Add(rating); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); screenPos.y += LIST_ROW_HEIGHT + 4; } @@ -246,7 +246,7 @@ public: uint16_t holes = td6->holes & 0x1F; auto ft = Formatter(); ft.Add(holes); - DrawTextBasic(&dpi, screenPos, STR_HOLES, ft); + DrawTextBasic(dpi, screenPos, STR_HOLES, ft); screenPos.y += LIST_ROW_HEIGHT; } else @@ -256,7 +256,7 @@ public: uint16_t speed = ((td6->max_speed << 16) * 9) >> 18; auto ft = Formatter(); ft.Add(speed); - DrawTextBasic(&dpi, screenPos, STR_MAX_SPEED, ft); + DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); screenPos.y += LIST_ROW_HEIGHT; } // Average speed @@ -264,7 +264,7 @@ public: uint16_t speed = ((td6->average_speed << 16) * 9) >> 18; auto ft = Formatter(); ft.Add(speed); - DrawTextBasic(&dpi, screenPos, STR_AVERAGE_SPEED, ft); + DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); screenPos.y += LIST_ROW_HEIGHT; } } @@ -273,7 +273,7 @@ public: auto ft = Formatter(); ft.Add(STR_RIDE_LENGTH_ENTRY); ft.Add(td6->ride_length); - DrawTextEllipsised(&dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); + DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -284,7 +284,7 @@ public: int32_t gForces = td6->max_positive_vertical_g * 32; auto ft = Formatter(); ft.Add(gForces); - DrawTextBasic(&dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); + DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); screenPos.y += LIST_ROW_HEIGHT; } // Maximum negative vertical Gs @@ -292,7 +292,7 @@ public: int32_t gForces = td6->max_negative_vertical_g * 32; auto ft = Formatter(); ft.Add(gForces); - DrawTextBasic(&dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); + DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); screenPos.y += LIST_ROW_HEIGHT; } // Maximum lateral Gs @@ -300,7 +300,7 @@ public: int32_t gForces = td6->max_lateral_g * 32; auto ft = Formatter(); ft.Add(gForces); - DrawTextBasic(&dpi, screenPos, STR_MAX_LATERAL_G, ft); + DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); screenPos.y += LIST_ROW_HEIGHT; } if (td6->total_air_time != 0) @@ -309,7 +309,7 @@ public: int32_t airTime = td6->total_air_time * 25; auto ft = Formatter(); ft.Add(airTime); - DrawTextBasic(&dpi, screenPos, STR_TOTAL_AIR_TIME, ft); + DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); screenPos.y += LIST_ROW_HEIGHT; } } @@ -320,11 +320,11 @@ public: uint16_t drops = td6->drops & 0x3F; auto ft = Formatter(); ft.Add(drops); - DrawTextBasic(&dpi, screenPos, STR_DROPS, ft); + DrawTextBasic(dpi, screenPos, STR_DROPS, ft); screenPos.y += LIST_ROW_HEIGHT; // Drop height is multiplied by 0.75 - DrawTextBasic(&dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); + DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -336,7 +336,7 @@ public: // Inversions auto ft = Formatter(); ft.Add(inversions); - DrawTextBasic(&dpi, screenPos, STR_INVERSIONS, ft); + DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); screenPos.y += LIST_ROW_HEIGHT; } } @@ -348,7 +348,7 @@ public: auto ft = Formatter(); ft.Add(td6->space_required_x); ft.Add(td6->space_required_y); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -356,7 +356,7 @@ public: { auto ft = Formatter(); ft.Add(td6->cost); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); } } diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 1648af3996..d4a183a757 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -246,7 +246,7 @@ public: auto ft = Formatter(); ft.Add(gLandToolSize); screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->midY() }; - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } else if (gLandMountainMode) { @@ -266,7 +266,7 @@ public: { auto ft = Formatter(); ft.Add(gLandToolRaiseCost); - DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } screenCoords.y += 10; @@ -275,7 +275,7 @@ public: { auto ft = Formatter(); ft.Add(gLandToolLowerCost); - DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } screenCoords.y += 50; @@ -300,7 +300,7 @@ public: { auto ft = Formatter(); ft.Add(price); - DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } } diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index abae7d7e22..8faf882713 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -221,7 +221,7 @@ public: { auto ft = Formatter(); ft.Add(gLandToolSize); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } // Draw cost amount @@ -231,7 +231,7 @@ public: ft.Add(_landRightsCost); screenCoords = { window_land_rights_widgets[WIDX_PREVIEW].midX() + windowPos.x, window_land_rights_widgets[WIDX_PREVIEW].bottom + windowPos.y + 32 }; - DrawTextBasic(&dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 66f4c781a5..413b12acd6 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -756,7 +756,7 @@ public: const auto* normalisedPathC = normalisedPath.c_str(); auto ft = Formatter(); ft.Add(normalisedPathC); - DrawTextEllipsised(&dpi, windowPos + ScreenCoordsXY{ 4, 20 }, width - 8, STR_STRING, ft); + DrawTextEllipsised(dpi, windowPos + ScreenCoordsXY{ 4, 20 }, width - 8, STR_STRING, ft); // Name button text StringId id = STR_NONE; @@ -770,7 +770,7 @@ public: ft = Formatter(); ft.Add(id); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft, + dpi, windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft, { COLOUR_GREY }); // Date button text @@ -785,7 +785,7 @@ public: ft = Formatter(); ft.Add(id); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft, + dpi, windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft, { COLOUR_GREY }); } @@ -1002,7 +1002,7 @@ public: { auto ft = Formatter(); ft.Add(STR_RIGHTGUILLEMET); - DrawTextBasic(&dpi, { 0, y }, stringId, ft); + DrawTextBasic(dpi, { 0, y }, stringId, ft); } // Print filename @@ -1010,7 +1010,7 @@ public: ft.Add(STR_STRING); ft.Add(_listItems[i].name.c_str()); int32_t max_file_width = widgets[WIDX_SORT_NAME].width() - 10; - DrawTextEllipsised(&dpi, { 10, y }, max_file_width, stringId, ft); + DrawTextEllipsised(dpi, { 10, y }, max_file_width, stringId, ft); // Print formatted modified date, if this is a file if (_listItems[i].type == TYPE_FILE) @@ -1019,12 +1019,12 @@ public: ft.Add(STR_STRING); ft.Add(_listItems[i].date_formatted.c_str()); DrawTextEllipsised( - &dpi, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth, stringId, ft, { TextAlignment::RIGHT }); + dpi, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth, stringId, ft, { TextAlignment::RIGHT }); ft = Formatter(); ft.Add(STR_STRING); ft.Add(_listItems[i].time_formatted.c_str()); - DrawTextEllipsised(&dpi, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth, stringId, ft); + DrawTextEllipsised(dpi, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth, stringId, ft); } } } @@ -1179,7 +1179,7 @@ static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo* dpi) ft.Add(_window_overwrite_prompt_name); ScreenCoordsXY stringCoords(w->windowPos.x + w->width / 2, w->windowPos.y + (w->height / 2) - 3); - DrawTextWrapped(dpi, stringCoords, w->width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, ft, { TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, stringCoords, w->width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, ft, { TextAlignment::CENTRE }); } #pragma endregion diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index cc1686bbaf..a18e925f76 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -865,7 +865,7 @@ public: { auto ft = Formatter(); ft.Add(_landRightsToolSize); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } screenCoords.y = windowPos.y + window_map_widgets[WIDX_LAND_TOOL].bottom + 5; @@ -896,7 +896,7 @@ public: GfxFillRect( &dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, RideKeyColours[i]); - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, _mapLabels[i], {}); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, _mapLabels[i], {}); screenCoords.y += LIST_ROW_HEIGHT; if (i == 3) { @@ -908,7 +908,7 @@ public: else if (!WidgetIsActiveTool(*this, WIDX_SET_LAND_RIGHTS)) { DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP_SIZE_SPINNER_Y].top + 1 }, STR_MAP_SIZE, {}, + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP_SIZE_SPINNER_Y].top + 1 }, STR_MAP_SIZE, {}, { colours[1] }); } } diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 39dc6c9cf6..31010b3b8c 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -740,26 +740,27 @@ static void WindowMapgenBasePaint(WindowBase* w, DrawPixelInfo* dpi) const auto textColour = w->colours[1]; DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour }); + *dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_BASE_HEIGHT].top + 1 }, STR_BASE_HEIGHT_LABEL, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_BASE_HEIGHT].top + 1 }, STR_BASE_HEIGHT_LABEL, {}, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_FLOOR_TEXTURE].top + 1 }, STR_TERRAIN_LABEL, {}, { textColour }); + *dpi, w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_FLOOR_TEXTURE].top + 1 }, STR_TERRAIN_LABEL, {}, + { textColour }); auto ft = Formatter(); ft.Add((_baseHeight - 12) / 2); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_BASE_HEIGHT].left + 1, w->widgets[WIDX_BASE_HEIGHT].top + 1 }, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_BASE_HEIGHT].left + 1, w->widgets[WIDX_BASE_HEIGHT].top + 1 }, STR_COMMA16, ft, { w->colours[1] }); ft = Formatter(); ft.Add((_waterLevel - 12) / 2); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_WATER_LEVEL].left + 1, w->widgets[WIDX_WATER_LEVEL].top + 1 }, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_WATER_LEVEL].left + 1, w->widgets[WIDX_WATER_LEVEL].top + 1 }, STR_COMMA16, ft, { w->colours[1] }); } @@ -1054,57 +1055,58 @@ static void WindowMapgenSimplexPaint(WindowBase* w, DrawPixelInfo* dpi) const uint8_t textColour = w->colours[1]; DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_BASE_FREQUENCY, {}, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_OCTAVES, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_OCTAVES, + {}, { textColour }); + DrawTextBasic( + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour }); - DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, { textColour }); auto ft = Formatter(); ft.Add(_simplex_low); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_LOW].left + 1, w->widgets[WIDX_SIMPLEX_LOW].top + 1 }, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_LOW].left + 1, w->widgets[WIDX_SIMPLEX_LOW].top + 1 }, STR_COMMA16, ft, { textColour }); ft = Formatter(); ft.Add(_simplex_high); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_HIGH].left + 1, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 }, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_HIGH].left + 1, w->widgets[WIDX_SIMPLEX_HIGH].top + 1 }, STR_COMMA16, ft, { textColour }); ft = Formatter(); ft.Add(_simplex_base_freq); DrawTextBasic( - dpi, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, w->widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { textColour }); ft = Formatter(); ft.Add(_simplex_octaves); DrawTextBasic( - dpi, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_OCTAVES].left + 1, w->widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, STR_COMMA16, ft, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX].top + 1 }, STR_TERRAIN_LABEL, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX].top + 1 }, STR_TERRAIN_LABEL, {}, { textColour }); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_PLACE_TREES_CHECKBOX].top + 1 }, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_SIMPLEX_PLACE_TREES_CHECKBOX].top + 1 }, STR_MAPGEN_OPTION_PLACE_TREES, {}, { textColour }); ft = Formatter(); ft.Add((_waterLevel - 12) / 2); DrawTextBasic( - dpi, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1, w->widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, STR_COMMA16, ft, { textColour }); @@ -1261,13 +1263,13 @@ static void WindowMapgenHeightmapPaint(WindowBase* w, DrawPixelInfo* dpi) // Smooth strength label and value const colour_t strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour; DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, STR_MAPGEN_SMOOTH_STRENGTH, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, STR_MAPGEN_SMOOTH_STRENGTH, {}, { strengthColour }); auto ft = Formatter(); ft.Add(_heightmapSmoothStrength); DrawTextBasic( - dpi, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1, w->widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, STR_COMMA16, ft, { strengthColour }); @@ -1275,35 +1277,36 @@ static void WindowMapgenHeightmapPaint(WindowBase* w, DrawPixelInfo* dpi) // Low label and value const colour_t labelColour = _heightmapLoaded ? enabledColour : disabledColour; DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, { labelColour }); ft = Formatter(); ft.Add(_heightmapLow); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_LOW].left + 1, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_LOW].left + 1, w->widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, STR_COMMA16, ft, { labelColour }); // High label and value DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, { labelColour }); ft = Formatter(); ft.Add(_heightmapHigh); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_HIGH].left + 1, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, + *dpi, + w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_HIGH].left + 1, w->widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, STR_COMMA16, ft, { labelColour }); // Water level label and value DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, + *dpi, w->windowPos + ScreenCoordsXY{ 5, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, { labelColour }); ft = Formatter(); ft.Add(_waterLevel); DrawTextBasic( - dpi, + *dpi, w->windowPos + ScreenCoordsXY{ w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1, w->widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, STR_COMMA16, ft, { labelColour }); diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 1a9f40819b..c99f2e50de 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -147,5 +147,5 @@ static void WindowMapTooltipPaint(WindowBase* w, DrawPixelInfo* dpi) } ScreenCoordsXY stringCoords(w->windowPos.x + (w->width / 2), w->windowPos.y + (w->height / 2)); - DrawTextWrapped(dpi, stringCoords, w->width, STR_MAP_TOOLTIP_STRINGID, _mapTooltipArgs, { TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, stringCoords, w->width, STR_MAP_TOOLTIP_STRINGID, _mapTooltipArgs, { TextAlignment::CENTRE }); } diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 18313f3125..598dba55f0 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -412,7 +412,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi) { auto ft = Formatter(); ft.Add(name.c_str()); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] }); + screenCoords.y += DrawTextWrapped(*dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] }); screenCoords.y += LIST_ROW_HEIGHT / 2; } @@ -421,7 +421,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi) { auto ft = Formatter(); ft.Add(description.c_str()); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] }); + screenCoords.y += DrawTextWrapped(*dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] }); screenCoords.y += LIST_ROW_HEIGHT / 2; } @@ -430,7 +430,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi) { auto ft = Formatter(); ft.Add(providerName.c_str()); - DrawTextBasic(dpi, screenCoords, STR_PROVIDER_NAME, ft); + DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_NAME, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -439,7 +439,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi) { auto ft = Formatter(); ft.Add(providerEmail.c_str()); - DrawTextBasic(dpi, screenCoords, STR_PROVIDER_EMAIL, ft); + DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_EMAIL, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -448,7 +448,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi) { auto ft = Formatter(); ft.Add(providerWebsite.c_str()); - DrawTextBasic(dpi, screenCoords, STR_PROVIDER_WEBSITE, ft); + DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_WEBSITE, ft); } } } @@ -569,7 +569,7 @@ static void WindowMultiplayerPlayersPaint(WindowBase* w, DrawPixelInfo* dpi) auto screenCoords = w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 }; auto ft = Formatter(); ft.Add(w->no_list_items); - DrawTextBasic(dpi, screenCoords, stringId, ft, { w->colours[2] }); + DrawTextBasic(*dpi, screenCoords, stringId, ft, { w->colours[2] }); } static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex) @@ -617,7 +617,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp } screenCoords.x = 0; GfxClipString(_buffer.data(), 230, FontStyle::Medium); - GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); + GfxDrawString(*dpi, screenCoords, _buffer.c_str(), { colour }); // Draw group name _buffer.resize(0); @@ -628,7 +628,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp screenCoords.x = 173; _buffer += NetworkGetGroupName(group); GfxClipString(_buffer.data(), 80, FontStyle::Medium); - GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); + GfxDrawString(*dpi, screenCoords, _buffer.c_str(), { colour }); } // Draw last action @@ -642,7 +642,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp { ft.Add(STR_ACTION_NA); } - DrawTextEllipsised(dpi, { 256, screenCoords.y }, 100, STR_BLACK_STRING, ft); + DrawTextEllipsised(*dpi, { 256, screenCoords.y }, 100, STR_BLACK_STRING, ft); // Draw ping _buffer.resize(0); @@ -665,7 +665,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp _buffer += pingBuffer; screenCoords.x = 356; - GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); + GfxDrawString(*dpi, screenCoords, _buffer.c_str(), { colour }); } screenCoords.y += SCROLLABLE_ROW_HEIGHT; listPosition++; @@ -858,7 +858,7 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(_buffer.c_str()); DrawTextEllipsised( - dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, + *dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, { TextAlignment::CENTRE }); } @@ -866,7 +866,7 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi) + ScreenCoordsXY{ window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].left + 4, window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].top + 4 }; - DrawTextBasic(dpi, screenPos, STR_DEFAULT_GROUP, {}, { w->colours[2] }); + DrawTextBasic(*dpi, screenPos, STR_DEFAULT_GROUP, {}, { w->colours[2] }); screenPos.y += 20; @@ -883,7 +883,7 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(_buffer.c_str()); DrawTextEllipsised( - dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, + *dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, { TextAlignment::CENTRE }); } } @@ -916,14 +916,14 @@ static void WindowMultiplayerGroupsScrollpaint(WindowBase* w, DrawPixelInfo* dpi if (NetworkCanPerformAction(groupindex, static_cast(i))) { screenCoords.x = 0; - GfxDrawString(dpi, screenCoords, u8"{WINDOW_COLOUR_2}✓", {}); + GfxDrawString(*dpi, screenCoords, u8"{WINDOW_COLOUR_2}✓", {}); } } // Draw action name auto ft = Formatter(); ft.Add(NetworkGetActionNameStringID(i)); - DrawTextBasic(dpi, { 10, screenCoords.y }, STR_WINDOW_COLOUR_2_STRINGID, ft); + DrawTextBasic(*dpi, { 10, screenCoords.y }, STR_WINDOW_COLOUR_2_STRINGID, ft); } screenCoords.y += SCROLLABLE_ROW_HEIGHT; } diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 434165ba48..2875e9e5cd 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -106,7 +106,7 @@ public: GfxClipString(_buffer.data(), widgets[WIDX_BACKGROUND].right - 50, FontStyle::Medium); ScreenCoordsXY screenCoords(windowPos.x + (width / 2), windowPos.y + (height / 2)); screenCoords.x -= GfxGetStringWidth(_buffer, FontStyle::Medium) / 2; - GfxDrawString(&dpi, screenCoords, _buffer.c_str()); + GfxDrawString(dpi, screenCoords, _buffer.c_str()); } void SetCloseCallBack(close_callback onClose) diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 518d1d26b0..a5295b8558 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -353,7 +353,7 @@ public: auto ft = Formatter(); ft.Add(campaign.no_weeks); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ spinnerWidget->left + 1, spinnerWidget->top }, + dpi, windowPos + ScreenCoordsXY{ spinnerWidget->left + 1, spinnerWidget->top }, campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, ft, { colours[0] }); screenCoords = windowPos + ScreenCoordsXY{ 14, 60 }; @@ -361,13 +361,13 @@ public: // Price per week ft = Formatter(); ft.Add(AdvertisingCampaignPricePerWeek[campaign.campaign_type]); - DrawTextBasic(&dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft); + DrawTextBasic(dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft); screenCoords.y += 13; // Total price ft = Formatter(); ft.Add(AdvertisingCampaignPricePerWeek[campaign.campaign_type] * campaign.no_weeks); - DrawTextBasic(&dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft); + DrawTextBasic(dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft); } }; diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 5bf54f3f96..8ebc72447e 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -928,7 +928,7 @@ private: // Ride name and description ft.Add(rideNaming.Name); ft.Add(rideNaming.Description); - DrawTextWrapped(&dpi, screenPos, textWidth, STR_NEW_RIDE_NAME_AND_DESCRIPTION, ft); + DrawTextWrapped(dpi, screenPos, textWidth, STR_NEW_RIDE_NAME_AND_DESCRIPTION, ft); if (!_vehicleAvailability.empty()) { @@ -936,13 +936,13 @@ private: { ft = Formatter(); ft.Add(rideEntry->naming.Name); - DrawTextEllipsised(&dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_NEW_RIDE_VEHICLE_NAME, ft); + DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_NEW_RIDE_VEHICLE_NAME, ft); } else { ft = Formatter(); ft.Add(_vehicleAvailability.c_str()); - DrawTextEllipsised(&dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_AVAILABLE_VEHICLES, ft); + DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_AVAILABLE_VEHICLES, ft); } } @@ -950,7 +950,7 @@ private: auto designCountStringId = GetDesignsAvailableStringId(count); ft = Formatter(); ft.Add(count); - DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ 0, 51 }, designCountStringId, ft); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ 0, 51 }, designCountStringId, ft); // Price if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) @@ -969,7 +969,7 @@ private: ft = Formatter(); ft.Add(price); - DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ textWidth, 51 }, stringId, ft, { TextAlignment::RIGHT }); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ textWidth, 51 }, stringId, ft, { TextAlignment::RIGHT }); } } diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 8a85a529a9..0f2ce05ebb 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -199,13 +199,13 @@ public: auto ft = Formatter(); ft.Add(DateDayNames[newsItem.Day - 1]); ft.Add(DateGameMonthNames[DateGetMonth(newsItem.MonthYear)]); - DrawTextBasic(&dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontStyle::Small }); + DrawTextBasic(dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontStyle::Small }); } // Item text { auto ft = Formatter(); ft.Add(newsItem.Text.c_str()); - DrawTextWrapped(&dpi, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { FontStyle::Small }); + DrawTextWrapped(dpi, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { FontStyle::Small }); } // Subject button if ((newsItem.TypeHasSubject()) && !(newsItem.HasButton())) diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index 4cefa4fe6a..cfb68c9ee8 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -492,13 +492,13 @@ public: // Draw explanatory message auto ft = Formatter(); ft.Add(STR_OBJECT_ERROR_WINDOW_EXPLANATION); - DrawTextWrapped(&dpi, windowPos + ScreenCoordsXY{ 5, 18 }, WW - 10, STR_BLACK_STRING, ft); + DrawTextWrapped(dpi, windowPos + ScreenCoordsXY{ 5, 18 }, WW - 10, STR_BLACK_STRING, ft); // Draw file name ft = Formatter(); ft.Add(STR_OBJECT_ERROR_WINDOW_FILE); ft.Add(_filePath.c_str()); - DrawTextEllipsised(&dpi, { windowPos.x + 5, windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft); + DrawTextEllipsised(dpi, { windowPos.x + 5, windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft); } void OnScrollDraw(const int32_t scrollIndex, DrawPixelInfo& dpi) override @@ -536,18 +536,18 @@ public: auto name = entry.GetName(); char buffer[256]; String::Set(buffer, sizeof(buffer), name.data(), name.size()); - GfxDrawString(&dpi, screenCoords, buffer, { COLOUR_DARK_GREEN }); + GfxDrawString(dpi, screenCoords, buffer, { COLOUR_DARK_GREEN }); if (entry.Generation == ObjectGeneration::DAT) { // ... source game ... const auto sourceStringId = ObjectManagerGetSourceGameString(entry.Entry.GetSourceGame()); - DrawTextBasic(&dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN }); + DrawTextBasic(dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN }); } // ... and type const auto type = GetStringFromObjectType(entry.GetType()); - DrawTextBasic(&dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN }); + DrawTextBasic(dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN }); } } diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 1885191caa..e3ac323f52 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -914,7 +914,7 @@ private: auto ft = Formatter(); ft.Add(static_cast(gConfigGeneral.WindowScale * 100)); DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SCALE].left + 1, widgets[WIDX_SCALE].top + 1 }, + *dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SCALE].left + 1, widgets[WIDX_SCALE].top + 1 }, STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { colours[1] }); } #pragma endregion @@ -2002,7 +2002,7 @@ private: auto ft = Formatter(); ft.Add(static_cast(gConfigGeneral.AutosaveAmount)); DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, + *dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, STR_WINDOW_COLOUR_2_COMMA16, ft, { colours[1] }); const auto normalisedPath = Platform::StrDecompToPrecomp(gConfigGeneral.RCT1Path); @@ -2017,7 +2017,7 @@ private: uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0; ScreenCoordsXY screenCoords = { windowPos.x + pathWidget.left + 1, windowPos.y + pathWidget.top + static_cast(padding) }; - DrawTextEllipsised(dpi, screenCoords, 277, STR_STRING, ft, { colours[1] }); + DrawTextEllipsised(*dpi, screenCoords, 277, STR_STRING, ft, { colours[1] }); } OpenRCT2String AdvancedTooltip(WidgetIndex widgetIndex, StringId fallback) diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index a92ea9e6d2..1dc9456c02 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -604,7 +604,7 @@ private: auto* labelWidget = &widgets[WIDX_STATUS]; DrawTextEllipsised( - &dpi, windowPos + ScreenCoordsXY{ labelWidget->midX(), labelWidget->top }, labelWidget->width(), STR_BLACK_STRING, + dpi, windowPos + ScreenCoordsXY{ labelWidget->midX(), labelWidget->top }, labelWidget->width(), STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); } @@ -696,7 +696,7 @@ private: // Current value auto ft = Formatter(); ft.Add(gParkRating); - DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft); // Graph border GfxFillRectInset( @@ -713,8 +713,7 @@ private: ft = Formatter(); ft.Add(axisValue); DrawTextBasic( - &dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, - { FontStyle::Small, TextAlignment::RIGHT }); + dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, { FontStyle::Small, TextAlignment::RIGHT }); GfxFillRectInset( &dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2], INSET_RECT_FLAG_BORDER_INSET); @@ -769,7 +768,7 @@ private: // Current value auto ft = Formatter(); ft.Add(gNumGuestsInPark); - DrawTextBasic(&dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft); // Graph border GfxFillRectInset( @@ -786,8 +785,7 @@ private: ft = Formatter(); ft.Add(axisValue); DrawTextBasic( - &dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, - { FontStyle::Small, TextAlignment::RIGHT }); + dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, { FontStyle::Small, TextAlignment::RIGHT }); GfxFillRectInset( &dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2], INSET_RECT_FLAG_BORDER_INSET); @@ -897,14 +895,14 @@ private: + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 30 }; auto ft = Formatter(); ft.Add(gTotalIncomeFromAdmissions); - DrawTextBasic(&dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft); + DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft); money64 parkEntranceFee = ParkGetEntranceFee(); auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH; screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PRICE].left + 1, widgets[WIDX_PRICE].top + 1 }; ft = Formatter(); ft.Add(parkEntranceFee); - DrawTextBasic(&dpi, screenCoords, stringId, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, stringId, ft, { colours[1] }); } #pragma endregion @@ -970,7 +968,7 @@ private: } auto ft = Formatter(); ft.Add(parkSize); - DrawTextBasic(&dpi, screenCoords, stringIndex, ft); + DrawTextBasic(dpi, screenCoords, stringIndex, ft); screenCoords.y += LIST_ROW_HEIGHT; // Draw number of rides / attractions @@ -978,7 +976,7 @@ private: { ft = Formatter(); ft.Add(_numberOfRides); - DrawTextBasic(&dpi, screenCoords, STR_NUMBER_OF_RIDES_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_NUMBER_OF_RIDES_LABEL, ft); } screenCoords.y += LIST_ROW_HEIGHT; @@ -987,19 +985,19 @@ private: { ft = Formatter(); ft.Add(_numberOfStaff); - DrawTextBasic(&dpi, screenCoords, STR_STAFF_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_STAFF_LABEL, ft); } screenCoords.y += LIST_ROW_HEIGHT; // Draw number of guests in park ft = Formatter(); ft.Add(gNumGuestsInPark); - DrawTextBasic(&dpi, screenCoords, STR_GUESTS_IN_PARK_LABEL, ft); + DrawTextBasic(dpi, screenCoords, STR_GUESTS_IN_PARK_LABEL, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); ft.Add(gTotalAdmissions); - DrawTextBasic(&dpi, screenCoords, STR_TOTAL_ADMISSIONS, ft); + DrawTextBasic(dpi, screenCoords, STR_TOTAL_ADMISSIONS, ft); } #pragma endregion @@ -1072,11 +1070,11 @@ private: auto ft = Formatter(); ft.Add(STR_STRING); ft.Add(gScenarioDetails.c_str()); - screenCoords.y += DrawTextWrapped(&dpi, screenCoords, 222, STR_BLACK_STRING, ft); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, 222, STR_BLACK_STRING, ft); screenCoords.y += 5; // Your objective: - DrawTextBasic(&dpi, screenCoords, STR_OBJECTIVE_LABEL); + DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_LABEL); screenCoords.y += LIST_ROW_HEIGHT; // Objective @@ -1101,7 +1099,7 @@ private: ft.Add(gScenarioObjective.Currency); } - screenCoords.y += DrawTextWrapped(&dpi, screenCoords, 221, ObjectiveNames[gScenarioObjective.Type], ft); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, 221, ObjectiveNames[gScenarioObjective.Type], ft); screenCoords.y += 5; // Objective outcome @@ -1110,14 +1108,14 @@ private: if (gScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) { // Objective failed - DrawTextWrapped(&dpi, screenCoords, 222, STR_OBJECTIVE_FAILED); + DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_FAILED); } else { // Objective completed ft = Formatter(); ft.Add(gScenarioCompletedCompanyValue); - DrawTextWrapped(&dpi, screenCoords, 222, STR_OBJECTIVE_ACHIEVED, ft); + DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_ACHIEVED, ft); } } } @@ -1162,13 +1160,13 @@ private: for (const auto& award : GetAwards()) { GfxDrawSprite(&dpi, ImageId(_parkAwards[EnumValue(award.Type)].sprite), screenCoords); - DrawTextWrapped(&dpi, screenCoords + ScreenCoordsXY{ 34, 6 }, 180, _parkAwards[EnumValue(award.Type)].text); + DrawTextWrapped(dpi, screenCoords + ScreenCoordsXY{ 34, 6 }, 180, _parkAwards[EnumValue(award.Type)].text); screenCoords.y += 32; } if (GetAwards().empty()) - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 6, 6 }, STR_NO_RECENT_AWARDS); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 6, 6 }, STR_NO_RECENT_AWARDS); } #pragma endregion diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 011c0bc6bf..5c5a775a38 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -142,7 +142,7 @@ public: windowPos.y + PatrolAreaWidgets[WIDX_PREVIEW].midY() }; auto ft = Formatter(); ft.Add(gLandToolSize); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index f5738e006b..07a6092f48 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -324,7 +324,7 @@ void WindowPlayerOverviewPaint(WindowBase* w, DrawPixelInfo* dpi) ft.Add(_buffer.c_str()); DrawTextEllipsised( - dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, + *dpi, w->windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, { TextAlignment::CENTRE }); } @@ -333,10 +333,10 @@ void WindowPlayerOverviewPaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(STR_PING); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); + DrawTextBasic(*dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); char ping[64]; snprintf(ping, 64, "%d ms", NetworkGetPlayerPing(player)); - GfxDrawString(dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { w->colours[2] }); + GfxDrawString(*dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { w->colours[2] }); // Draw last action screenCoords = w->windowPos + ScreenCoordsXY{ w->width / 2, w->height - 13 }; @@ -351,7 +351,7 @@ void WindowPlayerOverviewPaint(WindowBase* w, DrawPixelInfo* dpi) { ft.Add(STR_ACTION_NA); } - DrawTextEllipsised(dpi, screenCoords, width, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE }); + DrawTextEllipsised(*dpi, screenCoords, width, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE }); if (w->viewport != nullptr && w->var_492 != -1) { @@ -488,13 +488,13 @@ void WindowPlayerStatisticsPaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(NetworkGetPlayerCommandsRan(player)); - DrawTextBasic(dpi, screenCoords, STR_COMMANDS_RAN, ft); + DrawTextBasic(*dpi, screenCoords, STR_COMMANDS_RAN, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); ft.Add(NetworkGetPlayerMoneySpent(player)); - DrawTextBasic(dpi, screenCoords, STR_MONEY_SPENT, ft); + DrawTextBasic(*dpi, screenCoords, STR_MONEY_SPENT, ft); } static void WindowPlayerSetPage(WindowBase* w, int32_t page) diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index 6014d12709..ee9cbab032 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -86,7 +86,7 @@ public: ft.Add(_demolishRideCost / 2); ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3); - DrawTextWrapped(&dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); + DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); } } }; diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 6b009ceefc..cac555833b 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -273,19 +273,19 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge // Research type auto ft = Formatter(); ft.Add(STR_RESEARCH_UNKNOWN); - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft); + DrawTextWrapped(*dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft); screenCoords.y += 25; // Progress ft = Formatter(); ft.Add(STR_RESEARCH_COMPLETED_AL); - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); + DrawTextWrapped(*dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); screenCoords.y += 15; // Expected ft = Formatter(); ft.Add(STR_RESEARCH_STAGE_UNKNOWN); - DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); + DrawTextBasic(*dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); } else { @@ -322,13 +322,13 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge { ft.Add(gResearchNextItem->GetName()); } - DrawTextWrapped(dpi, screenCoords, 296, label, ft); + DrawTextWrapped(*dpi, screenCoords, 296, label, ft); screenCoords.y += 25; // Progress ft = Formatter(); ft.Add(ResearchStageNames[gResearchProgressStage]); - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); + DrawTextWrapped(*dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); screenCoords.y += 15; // Expected @@ -344,7 +344,7 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge { ft.Add(STR_RESEARCH_STAGE_UNKNOWN); } - DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); + DrawTextBasic(*dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); } // Last development @@ -379,7 +379,7 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge } } - DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, ft); + DrawTextWrapped(*dpi, screenCoords, 266, lastDevelopmentFormat, ft); } } @@ -544,7 +544,7 @@ void WindowResearchFundingPagePaint(WindowBase* w, DrawPixelInfo* dpi, WidgetInd int32_t currentResearchLevel = gResearchFundingLevel; auto ft = Formatter(); ft.Add(research_cost_table[currentResearchLevel]); - DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ft); + DrawTextBasic(*dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ft); } #pragma endregion diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index d5f5ce6249..fced7c5ab3 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -2621,7 +2621,7 @@ static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo* dpi) widget = &window_ride_main_widgets[WIDX_VIEW]; DrawTextBasic( - dpi, { w->windowPos.x + (widget->left + widget->right - 11) / 2, w->windowPos.y + widget->top }, + *dpi, { w->windowPos.x + (widget->left + widget->right - 11) / 2, w->windowPos.y + widget->top }, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); // Status @@ -2629,7 +2629,7 @@ static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo* dpi) widget = &window_ride_main_widgets[WIDX_STATUS]; StringId rideStatus = WindowRideGetStatus(w, ft); DrawTextEllipsised( - dpi, w->windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width(), rideStatus, ft, + *dpi, w->windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width(), rideStatus, ft, { TextAlignment::CENTRE }); } @@ -2903,13 +2903,13 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi) // Description auto ft = Formatter(); ft.Add(rideEntry->naming.Description); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, 300, STR_BLACK_STRING, ft, { TextAlignment::LEFT }); + screenCoords.y += DrawTextWrapped(*dpi, screenCoords, 300, STR_BLACK_STRING, ft, { TextAlignment::LEFT }); screenCoords.y += 2; // Capacity ft = Formatter(); ft.Add(rideEntry->capacity); - DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft); + DrawTextBasic(*dpi, screenCoords, STR_CAPACITY, ft); // Excitement Factor if (rideEntry->excitement_multiplier != 0) @@ -2919,7 +2919,7 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi) ft = Formatter(); ft.Add(abs(rideEntry->excitement_multiplier)); StringId stringId = rideEntry->excitement_multiplier > 0 ? STR_EXCITEMENT_FACTOR : STR_EXCITEMENT_FACTOR_NEGATIVE; - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); } // Intensity Factor @@ -2934,7 +2934,7 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi) ft = Formatter(); ft.Add(abs(rideEntry->intensity_multiplier)); StringId stringId = rideEntry->intensity_multiplier > 0 ? STR_INTENSITY_FACTOR : STR_INTENSITY_FACTOR_NEGATIVE; - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); if (lineHeight != 10) screenCoords.x -= 150; @@ -2948,7 +2948,7 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi) ft = Formatter(); ft.Add(abs(rideEntry->nausea_multiplier)); StringId stringId = rideEntry->nausea_multiplier > 0 ? STR_NAUSEA_FACTOR : STR_NAUSEA_FACTOR_NEGATIVE; - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); } } @@ -3743,7 +3743,7 @@ static void WindowRideOperatingPaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(ride->num_block_brakes + ride->num_stations); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 21, ride->mode == RideMode::PoweredLaunchBlockSectioned ? 89 : 61 }, + *dpi, w->windowPos + ScreenCoordsXY{ 21, ride->mode == RideMode::PoweredLaunchBlockSectioned ? 89 : 61 }, STR_BLOCK_SECTIONS, ft, COLOUR_BLACK); } } @@ -4135,7 +4135,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi) // Inspection label widget = &window_ride_maintenance_widgets[WIDX_INSPECTION_INTERVAL]; screenCoords = w->windowPos + ScreenCoordsXY{ 4, widget->top + 1 }; - DrawTextBasic(dpi, screenCoords, STR_INSPECTION); + DrawTextBasic(*dpi, screenCoords, STR_INSPECTION); // Reliability widget = &window_ride_maintenance_widgets[WIDX_PAGE_BACKGROUND]; @@ -4144,7 +4144,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi) uint16_t reliability = ride->reliability_percentage; auto ft = Formatter(); ft.Add(reliability); - DrawTextBasic(dpi, screenCoords, STR_RELIABILITY_LABEL_1757, ft); + DrawTextBasic(*dpi, screenCoords, STR_RELIABILITY_LABEL_1757, ft); WindowRideMaintenanceDrawBar( w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, std::max(10, reliability), COLOUR_BRIGHT_GREEN); screenCoords.y += 11; @@ -4152,7 +4152,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi) uint16_t downTime = ride->downtime; ft = Formatter(); ft.Add(downTime); - DrawTextBasic(dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, ft); + DrawTextBasic(*dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, ft); WindowRideMaintenanceDrawBar(w, dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, downTime, COLOUR_BRIGHT_RED); screenCoords.y += 26; @@ -4167,7 +4167,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi) ft = Formatter(); ft.Add(ride->last_inspection); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += 12; // Last / current breakdown @@ -4177,7 +4177,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi) stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN; ft = Formatter(); ft.Add(RideBreakdownReasonNames[ride->breakdown_reason]); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += 12; // Mechanic status @@ -4215,7 +4215,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi) { if (stringId == STR_CALLING_MECHANIC || stringId == STR_NO_MECHANICS_ARE_HIRED_MESSAGE) { - DrawTextWrapped(dpi, screenCoords, 280, stringId, {}, { TextAlignment::LEFT }); + DrawTextWrapped(*dpi, screenCoords, 280, stringId, {}, { TextAlignment::LEFT }); } else { @@ -4224,7 +4224,7 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi) { ft = Formatter(); staff->FormatNameTo(ft); - DrawTextWrapped(dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT }); + DrawTextWrapped(*dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT }); } } } @@ -4988,7 +4988,7 @@ static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi) } } - DrawTextEllipsised(dpi, { w->windowPos.x + 3, w->windowPos.y + 103 }, 97, STR_STATION_STYLE, {}); + DrawTextEllipsised(*dpi, { w->windowPos.x + 3, w->windowPos.y + 103 }, 97, STR_STATION_STYLE, {}); } } @@ -5649,7 +5649,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) Widget* widget = &window_ride_measurements_widgets[WIDX_PAGE_BACKGROUND]; ScreenCoordsXY widgetCoords(w->windowPos.x + widget->width() / 2, w->windowPos.y + widget->top + 40); - DrawTextWrapped(dpi, widgetCoords, w->width - 8, STR_CLICK_ITEMS_OF_SCENERY_TO_SELECT, {}, { TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, widgetCoords, w->width - 8, STR_CLICK_ITEMS_OF_SCENERY_TO_SELECT, {}, { TextAlignment::CENTRE }); widgetCoords.x = w->windowPos.x + 4; widgetCoords.y = w->windowPos.y + window_ride_measurements_widgets[WIDX_SELECT_NEARBY_SCENERY].bottom + 17; @@ -5674,7 +5674,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) ft.Add(ride->excitement); ft.Add(ratingName); StringId stringId = !RideHasRatings(*ride) ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE : STR_EXCITEMENT_RATING; - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Intensity @@ -5689,7 +5689,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) else if (ride->intensity >= RIDE_RATING(10, 00)) stringId = STR_INTENSITY_RATING_RED; - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Nausea @@ -5698,7 +5698,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) ft.Add(ride->nausea); ft.Add(ratingName); stringId = !RideHasRatings(*ride) ? STR_NAUSEA_RATING_NOT_YET_AVAILABLE : STR_NAUSEA_RATING; - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += 2 * LIST_ROW_HEIGHT; // Horizontal rule @@ -5713,7 +5713,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) // Holes ft = Formatter(); ft.Add(ride->holes); - DrawTextBasic(dpi, screenCoords, STR_HOLES, ft); + DrawTextBasic(*dpi, screenCoords, STR_HOLES, ft); screenCoords.y += LIST_ROW_HEIGHT; } else @@ -5721,13 +5721,13 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) // Max speed ft = Formatter(); ft.Add((ride->max_speed * 9) >> 18); - DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, ft); + DrawTextBasic(*dpi, screenCoords, STR_MAX_SPEED, ft); screenCoords.y += LIST_ROW_HEIGHT; // Average speed ft = Formatter(); ft.Add((ride->average_speed * 9) >> 18); - DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, ft); + DrawTextBasic(*dpi, screenCoords, STR_AVERAGE_SPEED, ft); screenCoords.y += LIST_ROW_HEIGHT; // Ride time @@ -5764,7 +5764,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) ft.Add(0); ft.Add(0); ft.Add(0); - DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_TIME, ft); + DrawTextEllipsised(*dpi, screenCoords, 308, STR_RIDE_TIME, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -5803,7 +5803,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) ft.Add(0); ft.Add(0); ft.Add(0); - DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_LENGTH, ft); + DrawTextEllipsised(*dpi, screenCoords, 308, STR_RIDE_LENGTH, ft); screenCoords.y += LIST_ROW_HEIGHT; @@ -5814,7 +5814,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) ft = Formatter(); ft.Add(ride->max_positive_vertical_g); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Max. negative vertical G's @@ -5822,20 +5822,20 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) : STR_MAX_NEGATIVE_VERTICAL_G; ft = Formatter(); ft.Add(ride->max_negative_vertical_g); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Max lateral G's stringId = ride->max_lateral_g > RIDE_G_FORCES_RED_LATERAL ? STR_MAX_LATERAL_G_RED : STR_MAX_LATERAL_G; ft = Formatter(); ft.Add(ride->max_lateral_g); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Total 'air' time ft = Formatter(); ft.Add(ride->total_air_time * 3); - DrawTextBasic(dpi, screenCoords, STR_TOTAL_AIR_TIME, ft); + DrawTextBasic(*dpi, screenCoords, STR_TOTAL_AIR_TIME, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -5845,14 +5845,14 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) auto drops = ride->drops & 0x3F; ft = Formatter(); ft.Add(drops); - DrawTextBasic(dpi, screenCoords, STR_DROPS, ft); + DrawTextBasic(*dpi, screenCoords, STR_DROPS, ft); screenCoords.y += LIST_ROW_HEIGHT; // Highest drop height auto highestDropHeight = (ride->highest_drop_height * 3) / 4; ft = Formatter(); ft.Add(highestDropHeight); - DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft); + DrawTextBasic(*dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -5863,7 +5863,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) { ft = Formatter(); ft.Add(ride->inversions); - DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, ft); + DrawTextBasic(*dpi, screenCoords, STR_INVERSIONS, ft); screenCoords.y += LIST_ROW_HEIGHT; } } @@ -5871,7 +5871,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi) } else { - DrawTextBasic(dpi, screenCoords, STR_NO_TEST_RESULTS_YET); + DrawTextBasic(*dpi, screenCoords, STR_NO_TEST_RESULTS_YET); } } } @@ -6154,7 +6154,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32 // No measurement message ScreenCoordsXY stringCoords(widget->width() / 2, widget->height() / 2 - 5); int32_t width = widget->width() - 2; - DrawTextWrapped(dpi, stringCoords, width, message.str, message.args, { TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, stringCoords, width, message.str, message.args, { TextAlignment::CENTRE }); return; } @@ -6205,7 +6205,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32 auto ft = Formatter(); ft.Add(scaled_yUnit); - DrawTextBasic(dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontStyle::Small }); + DrawTextBasic(*dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontStyle::Small }); } // Time marks @@ -6215,7 +6215,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32 auto ft = Formatter(); ft.Add(time); if (x + 80 >= dpi->x) - DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small }); + DrawTextBasic(*dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small }); time += 5; } @@ -6781,7 +6781,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(profit); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); } screenCoords.y += 44; @@ -6805,7 +6805,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(profit); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); } screenCoords.y += 18; @@ -6815,7 +6815,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(ride->income_per_hour); - DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, ft); + DrawTextBasic(*dpi, screenCoords, STR_INCOME_PER_HOUR, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -6824,7 +6824,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi) stringId = ride->upkeep_cost == MONEY16_UNDEFINED ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR; auto ft = Formatter(); ft.Add(costPerHour); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Profit per hour @@ -6832,7 +6832,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi) { ft = Formatter(); ft.Add(ride->profit); - DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, ft); + DrawTextBasic(*dpi, screenCoords, STR_PROFIT_PER_HOUR, ft); screenCoords.y += LIST_ROW_HEIGHT; } screenCoords.y += 5; @@ -6840,7 +6840,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi) // Total profit ft = Formatter(); ft.Add(ride->total_profit); - DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, ft); + DrawTextBasic(*dpi, screenCoords, STR_TOTAL_PROFIT, ft); } #pragma endregion @@ -6992,14 +6992,14 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi) { auto ft = Formatter(); ft.Add(ride->num_riders); - DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft); + DrawTextBasic(*dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft); screenCoords.y += LIST_ROW_HEIGHT; } // Customers per hour auto ft = Formatter(); ft.Add(RideCustomersPerHour(*ride)); - DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft); + DrawTextBasic(*dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft); screenCoords.y += LIST_ROW_HEIGHT; // Popularity @@ -7015,7 +7015,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi) } ft = Formatter(); ft.Add(popularity); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Satisfaction @@ -7031,7 +7031,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi) } ft = Formatter(); ft.Add(satisfaction); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; // Queue time @@ -7041,7 +7041,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi) stringId = queueTime == 1 ? STR_QUEUE_TIME_MINUTE : STR_QUEUE_TIME_MINUTES; ft = Formatter(); ft.Add(queueTime); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT }); + screenCoords.y += DrawTextWrapped(*dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT }); screenCoords.y += 5; } @@ -7052,7 +7052,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi) ft = Formatter(); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add(ride->no_primary_items_sold); - DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); + DrawTextBasic(*dpi, screenCoords, STR_ITEMS_SOLD, ft); screenCoords.y += LIST_ROW_HEIGHT; } @@ -7064,14 +7064,14 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi) ft = Formatter(); ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); ft.Add(ride->no_secondary_items_sold); - DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); + DrawTextBasic(*dpi, screenCoords, STR_ITEMS_SOLD, ft); screenCoords.y += LIST_ROW_HEIGHT; } // Total customers ft = Formatter(); ft.Add(ride->total_customers); - DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft); + DrawTextBasic(*dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft); screenCoords.y += LIST_ROW_HEIGHT; // Guests favourite @@ -7080,7 +7080,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi) ft = Formatter(); ft.Add(ride->guests_favourite); stringId = ride->guests_favourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS; - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); screenCoords.y += LIST_ROW_HEIGHT; } screenCoords.y += 2; @@ -7091,7 +7091,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi) stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? STR_BUILT_LAST_YEAR : STR_BUILT_YEARS_AGO; ft = Formatter(); ft.Add(age); - DrawTextBasic(dpi, screenCoords, stringId, ft); + DrawTextBasic(*dpi, screenCoords, stringId, ft); } #pragma endregion diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 37e5c28fa9..bfa578008a 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1520,14 +1520,14 @@ public: // Draw cost screenCoords = { windowPos.x + widget->midX(), windowPos.y + widget->bottom - 23 }; if (_rideConstructionState != RideConstructionState::Place) - DrawTextBasic(&dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); screenCoords.y += 11; if (_currentTrackPrice != MONEY32_UNDEFINED && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { auto ft = Formatter(); ft.Add(_currentTrackPrice); - DrawTextBasic(&dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 604f35c5fd..b3c96811c9 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -516,7 +516,7 @@ public: auto ft = Formatter(); ft.Add(static_cast(_rideList.size())); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[page], ft); + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[page], ft); } /** @@ -547,7 +547,7 @@ public: // Ride name auto ft = Formatter(); ridePtr->FormatNameTo(ft); - DrawTextEllipsised(&dpi, { 0, y - 1 }, 159, format, ft); + DrawTextEllipsised(dpi, { 0, y - 1 }, 159, format, ft); // Ride information ft = Formatter(); @@ -724,7 +724,7 @@ public: ft.Rewind(); ft.Add(formatSecondary); } - DrawTextEllipsised(&dpi, { 160, y - 1 }, 157, format, ft); + DrawTextEllipsised(dpi, { 160, y - 1 }, 157, format, ft); y += SCROLLABLE_ROW_HEIGHT; } } diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 2f4108a09b..80d3a8e2ea 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -451,7 +451,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi) } ScreenCoordsXY stringCoords(widget->midX() + w->windowPos.x, widget->midY() + w->windowPos.y - 3); - DrawTextWrapped(dpi, stringCoords, 87, format, ft, { COLOUR_AQUAMARINE, fontStyle, TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, stringCoords, 87, format, ft, { COLOUR_AQUAMARINE, fontStyle, TextAlignment::CENTRE }); } // Return if no scenario highlighted @@ -465,8 +465,8 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi) + ScreenCoordsXY{ window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4, window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5 }; DrawTextEllipsised( - dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_SCENARIO_LOCKED, {}, { TextAlignment::CENTRE }); - DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_LOCKED_DESC); + *dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_SCENARIO_LOCKED, {}, { TextAlignment::CENTRE }); + DrawTextWrapped(*dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_LOCKED_DESC); } else { @@ -475,7 +475,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi) + ScreenCoordsXY{ window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4, window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5 }; - DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_HOVER_HINT); + DrawTextWrapped(*dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_HOVER_HINT); } return; } @@ -491,7 +491,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi) auto ft = Formatter(); ft.Add(pathPtr); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ TabWidth + 3, w->height - 3 - 11 }, STR_STRING, ft, { w->colours[1] }); + *dpi, w->windowPos + ScreenCoordsXY{ TabWidth + 3, w->height - 3 - 11 }, STR_STRING, ft, { w->colours[1] }); } // Scenario name @@ -502,14 +502,14 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi) ft.Add(STR_STRING); ft.Add(scenario->Name); DrawTextEllipsised( - dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); + *dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); screenPos.y += 15; // Scenario details ft = Formatter(); ft.Add(STR_STRING); ft.Add(scenario->Details); - screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_BLACK_STRING, ft) + 5; + screenPos.y += DrawTextWrapped(*dpi, screenPos, 170, STR_BLACK_STRING, ft) + 5; // Scenario objective ft = Formatter(); @@ -533,7 +533,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi) else ft.Add(scenario->ObjectiveArg2); } - screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_OBJECTIVE, ft) + 5; + screenPos.y += DrawTextWrapped(*dpi, screenPos, 170, STR_OBJECTIVE, ft) + 5; // Scenario score if (scenario->Highscore != nullptr) @@ -548,7 +548,7 @@ static void WindowScenarioselectPaint(WindowBase* w, DrawPixelInfo* dpi) ft.Add(STR_STRING); ft.Add(completedByName); ft.Add(scenario->Highscore->company_value); - screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, ft); + screenPos.y += DrawTextWrapped(*dpi, screenPos, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, ft); } } @@ -612,7 +612,7 @@ static void WindowScenarioselectScrollpaint(WindowBase* w, DrawPixelInfo* dpi, i const auto scrollCentre = window_scenarioselect_widgets[WIDX_SCENARIOLIST].width() / 2; DrawTextBasic( - dpi, { scrollCentre, y + 1 }, format, ft, { colour, FontStyle::Medium, TextAlignment::CENTRE, darkness }); + *dpi, { scrollCentre, y + 1 }, format, ft, { colour, FontStyle::Medium, TextAlignment::CENTRE, darkness }); // Check if scenario is completed if (isCompleted) @@ -634,7 +634,7 @@ static void WindowScenarioselectScrollpaint(WindowBase* w, DrawPixelInfo* dpi, i ft.Add(STR_STRING); ft.Add(buffer); DrawTextBasic( - dpi, { scrollCentre, y + scenarioTitleHeight + 1 }, format, ft, + *dpi, { scrollCentre, y + scenarioTitleHeight + 1 }, format, ft, { FontStyle::Small, TextAlignment::CENTRE }); } @@ -653,7 +653,7 @@ static void DrawCategoryHeading(WindowBase* w, DrawPixelInfo* dpi, int32_t left, // Draw string int32_t centreX = (left + right) / 2; - DrawTextBasic(dpi, { centreX, y }, stringId, {}, { baseColour, TextAlignment::CENTRE }); + DrawTextBasic(*dpi, { centreX, y }, stringId, {}, { baseColour, TextAlignment::CENTRE }); // Get string dimensions utf8 buffer[CommonTextBufferSize]; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 21ccef1a56..77846a5155 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -783,12 +783,12 @@ public: // -14 DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ width - 0x1A, height - 13 }, STR_COST_LABEL, ft, { TextAlignment::RIGHT }); + dpi, windowPos + ScreenCoordsXY{ width - 0x1A, height - 13 }, STR_COST_LABEL, ft, { TextAlignment::RIGHT }); } auto ft = Formatter(); ft.Add(name); - DrawTextEllipsised(&dpi, { windowPos.x + 3, windowPos.y + height - 13 }, width - 19, STR_BLACK_STRING, ft); + DrawTextEllipsised(dpi, { windowPos.x + 3, windowPos.y + height - 13 }, width - 19, STR_BLACK_STRING, ft); } void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 1a082e95ec..4ad66748ad 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -187,7 +187,7 @@ public: const auto screenCoords = ScreenCoordsXY{ windowPos.x + preview.midX(), windowPos.y + preview.midY() }; auto ft = Formatter(); ft.Add(gWindowSceneryScatterSize); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } } }; diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 560ab95fef..479afa176d 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -376,19 +376,20 @@ static void WindowServerListPaint(WindowBase* w, DrawPixelInfo* dpi) WindowDrawWidgets(*w, dpi); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, {}, { COLOUR_WHITE }); + *dpi, w->windowPos + ScreenCoordsXY{ 6, w->widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, {}, + { COLOUR_WHITE }); // Draw version number std::string version = NetworkGetVersion(); auto ft = Formatter(); ft.Add(version.c_str()); DrawTextBasic( - dpi, w->windowPos + ScreenCoordsXY{ 324, w->widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, ft, + *dpi, w->windowPos + ScreenCoordsXY{ 324, w->widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, ft, { COLOUR_WHITE }); ft = Formatter(); ft.Add(_numPlayersOnline); - DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 8, w->height - 15 }, _statusText, ft, { COLOUR_WHITE }); + DrawTextBasic(*dpi, w->windowPos + ScreenCoordsXY{ 8, w->height - 15 }, _statusText, ft, { COLOUR_WHITE }); } static void WindowServerListScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex) @@ -449,7 +450,7 @@ static void WindowServerListScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32 // Finally, draw the server information. auto ft = Formatter(); ft.Add(serverInfoToShow); - DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo, STR_STRING, ft, { colour }); + DrawTextEllipsised(*dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo, STR_STRING, ft, { colour }); int32_t right = width - 7 - SCROLLBAR_WIDTH; @@ -480,7 +481,7 @@ static void WindowServerListScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32 // Draw number of players screenCoords.x = right - numPlayersStringWidth; - GfxDrawString(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, players, { w->colours[1] }); + GfxDrawString(*dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, players, { w->colours[1] }); screenCoords.y += ITEM_HEIGHT; } diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index a027e680ae..bf9d4f934d 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -237,16 +237,15 @@ public: void OnDraw(DrawPixelInfo& dpi) override { DrawWidgets(dpi); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PORT_INPUT].top }, STR_PORT, {}, { colours[1] }); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_NAME_INPUT].top }, STR_SERVER_NAME, {}, { colours[1] }); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PORT_INPUT].top }, STR_PORT, {}, { colours[1] }); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_NAME_INPUT].top }, STR_SERVER_NAME, {}, { colours[1] }); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_DESCRIPTION_INPUT].top }, STR_SERVER_DESCRIPTION, {}, + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_DESCRIPTION_INPUT].top }, STR_SERVER_DESCRIPTION, {}, { colours[1] }); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_GREETING_INPUT].top }, STR_SERVER_GREETING, {}, { colours[1] }); - DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PASSWORD_INPUT].top }, STR_PASSWORD, {}, { colours[1] }); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_MAXPLAYERS].top }, STR_MAX_PLAYERS, {}, { colours[1] }); + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_GREETING_INPUT].top }, STR_SERVER_GREETING, {}, { colours[1] }); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PASSWORD_INPUT].top }, STR_PASSWORD, {}, { colours[1] }); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_MAXPLAYERS].top }, STR_MAX_PLAYERS, {}, { colours[1] }); } private: diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 55a61b2a87..f82e403bd9 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -135,7 +135,7 @@ public: ft.Add(STR_STRING); ft.Add(_shortcutCustomName.c_str()); } - DrawTextWrapped(&dpi, stringCoords, 242, STR_SHORTCUT_CHANGE_PROMPT, ft, { TextAlignment::CENTRE }); + DrawTextWrapped(dpi, stringCoords, 242, STR_SHORTCUT_CHANGE_PROMPT, ft, { TextAlignment::CENTRE }); } private: @@ -523,14 +523,14 @@ private: ft.Add(STR_STRING); ft.Add(shortcut.CustomString.c_str()); } - DrawTextEllipsised(&dpi, { 0, y - 1 }, bindingOffset, format, ft); + DrawTextEllipsised(dpi, { 0, y - 1 }, bindingOffset, format, ft); if (!shortcut.Binding.empty()) { ft = Formatter(); ft.Add(STR_STRING); ft.Add(shortcut.Binding.c_str()); - DrawTextEllipsised(&dpi, { bindingOffset, y - 1 }, 150, format, ft); + DrawTextEllipsised(dpi, { bindingOffset, y - 1 }, 150, format, ft); } } }; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 82a8212cc6..0512c09a40 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -537,7 +537,7 @@ private: const auto& widget = widgets[WIDX_BTM_LABEL]; auto screenPos = windowPos + ScreenCoordsXY{ widget.midX(), widget.top }; int32_t widgetWidth = widget.width(); - DrawTextEllipsised(dpi, screenPos, widgetWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); + DrawTextEllipsised(*dpi, screenPos, widgetWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); } void DrawOverviewTabImage(DrawPixelInfo* dpi) @@ -928,13 +928,13 @@ private: { auto ft = Formatter(); ft.Add(GetStaffWage(staff->AssignedStaffType)); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_WAGES, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_WAGES, ft); screenCoords.y += LIST_ROW_HEIGHT; } auto ft = Formatter(); ft.Add(staff->GetHireDate()); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_EMPLOYED_FOR, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_EMPLOYED_FOR, ft); screenCoords.y += LIST_ROW_HEIGHT; switch (staff->AssignedStaffType) @@ -942,37 +942,37 @@ private: case StaffType::Handyman: ft = Formatter(); ft.Add(staff->StaffLawnsMown); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); ft.Add(staff->StaffGardensWatered); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); ft.Add(staff->StaffLitterSwept); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); ft.Add(staff->StaffBinsEmptied); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft); break; case StaffType::Mechanic: ft = Formatter(); ft.Add(staff->StaffRidesInspected); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); ft.Add(staff->StaffRidesFixed); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft); break; case StaffType::Security: ft = Formatter(); ft.Add(staff->StaffVandalsStopped); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft); + DrawTextBasic(*dpi, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft); break; case StaffType::Entertainer: case StaffType::Count: diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index fe024ce316..ae6157f776 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -81,7 +81,7 @@ public: peep->FormatNameTo(ft); ScreenCoordsXY textCoords(windowPos + ScreenCoordsXY{ WW / 2, (WH / 2) - 3 }); - DrawTextWrapped(&dpi, textCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE }); + DrawTextWrapped(dpi, textCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE }); } }; diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index c45dbfc9ef..88d459687a 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -285,13 +285,13 @@ public: { auto ft = Formatter(); ft.Add(GetStaffWage(GetSelectedStaffType())); - DrawTextBasic(&dpi, windowPos + ScreenCoordsXY{ width - 155, 32 }, STR_COST_PER_MONTH, ft); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ width - 155, 32 }, STR_COST_PER_MONTH, ft); } if (GetSelectedStaffType() != StaffType::Entertainer) { DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + 1 }, + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + 1 }, STR_UNIFORM_COLOUR); } @@ -303,7 +303,7 @@ public: ft.Add(staffTypeStringId); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_STAFF_LIST_LIST].bottom + 2 }, STR_STAFF_LIST_COUNTER, ft); + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_STAFF_LIST_LIST].bottom + 2 }, STR_STAFF_LIST_COUNTER, ft); } ScreenSize OnScrollGetSize(int32_t scrollIndex) override @@ -405,11 +405,11 @@ public: auto ft = Formatter(); peep->FormatNameTo(ft); - DrawTextEllipsised(&dpi, { 0, y }, nameColumnSize, format, ft); + DrawTextEllipsised(dpi, { 0, y }, nameColumnSize, format, ft); ft = Formatter(); peep->FormatActionTo(ft); - DrawTextEllipsised(&dpi, { actionOffset, y }, actionColumnSize, format, ft); + DrawTextEllipsised(dpi, { actionOffset, y }, actionColumnSize, format, ft); // True if a patrol path is set for the worker if (peep->HasPatrolArea()) diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 8462fb8dfd..f1a0ce2339 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -210,12 +210,12 @@ public: auto ft = Formatter(); ft.Add(_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(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN }); + GfxDrawString(dpi, screenCoords, static_cast(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN }); } void ExecuteCallback(bool hasValue) diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 4437a2a1c0..db06190513 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -453,7 +453,7 @@ public: if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) { DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 10, window_themes_widgets[WIDX_THEMES_PRESETS].top + 1 }, + dpi, windowPos + ScreenCoordsXY{ 10, window_themes_widgets[WIDX_THEMES_PRESETS].top + 1 }, STR_THEMES_LABEL_CURRENT_THEME, {}, { colours[1] }); size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); @@ -467,7 +467,7 @@ public: auto newWidth = windowPos.x + window_themes_widgets[WIDX_THEMES_PRESETS_DROPDOWN].left - window_themes_widgets[WIDX_THEMES_PRESETS].left - 4; - DrawTextEllipsised(&dpi, screenPos, newWidth, STR_STRING, ft, { colours[1] }); + DrawTextEllipsised(dpi, screenPos, newWidth, STR_STRING, ft, { colours[1] }); } } @@ -808,7 +808,7 @@ public: int32_t numColours = ThemeDescGetNumColours(wc); for (uint8_t j = 0; j < numColours; j++) { - DrawTextBasic(&dpi, { 2, screenCoords.y + 4 }, ThemeDescGetName(wc), {}, { colours[1] }); + DrawTextBasic(dpi, { 2, screenCoords.y + 4 }, ThemeDescGetName(wc), {}, { colours[1] }); uint8_t colour = ThemeGetColour(wc, j); const bool isPressed = (i == _colour_index_1 && j == _colour_index_2); @@ -822,7 +822,7 @@ public: if (colour & COLOUR_FLAG_TRANSLUCENT) { GfxDrawString( - &dpi, topLeft, static_cast(CheckBoxMarkString), + dpi, topLeft, static_cast(CheckBoxMarkString), { static_cast(colours[1] & 0x7F), FontStyle::Medium, TextDarkness::Dark }); } } diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 21e959317d..48c91214ed 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1009,24 +1009,24 @@ public: ScreenCoordsXY screenCoords(windowPos.x, windowPos.y); // Draw coordinates - GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(5, 24), "X:", { colours[1] }); - GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(74, 24), "Y:", { colours[1] }); + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 24), "X:", { colours[1] }); + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(74, 24), "Y:", { colours[1] }); if (_tileSelected) { auto tileCoords = TileCoordsXY{ _toolMap }; auto ft = Formatter(); ft.Add(tileCoords.x); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 43, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); + dpi, screenCoords + ScreenCoordsXY{ 43, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); ft = Formatter(); ft.Add(tileCoords.y); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 113, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); + dpi, screenCoords + ScreenCoordsXY{ 113, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); } else { - GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), "-", { colours[1] }); - GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), "-", { colours[1] }); + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), "-", { colours[1] }); + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), "-", { colours[1] }); } if (windowTileInspectorSelectedIndex != -1) @@ -1052,7 +1052,7 @@ public: terrainNameId = surfaceStyle->NameStringId; auto ft = Formatter(); ft.Add(terrainNameId); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { colours[1] }); // Edge texture name StringId terrainEdgeNameId = STR_EMPTY; @@ -1062,7 +1062,7 @@ public: ft = Formatter(); ft.Add(terrainEdgeNameId); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { colours[1] }); // Land ownership StringId landOwnership; @@ -1080,31 +1080,31 @@ public: ft = Formatter(); ft.Add(landOwnership); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, { colours[1] }); // Water level ft = Formatter(); ft.Add(tileElement->AsSurface()->GetWaterHeight()); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, ft, { colours[1] }); // Properties // Raise / lower label screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SURFACE_SPINNER_HEIGHT].top }; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); // Current base height screenCoords.x = windowPos.x + widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3; ft = Formatter(); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Raised corners screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SURFACE_CHECK_CORNER_E].top }; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_CORNERS, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_CORNERS, {}, { colours[1] }); break; } case TileElementType::Path: @@ -1120,7 +1120,7 @@ public: { auto ft = Formatter(); ft.Add(surfaceObj->NameStringId); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_FOOTPATH_SURFACE_NAME, ft, { COLOUR_WHITE }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_FOOTPATH_SURFACE_NAME, ft, { COLOUR_WHITE }); } // Railings name @@ -1130,7 +1130,7 @@ public: auto ft = Formatter(); ft.Add(railingsObj->NameStringId); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_FOOTPATH_RAILINGS_NAME, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_FOOTPATH_RAILINGS_NAME, ft, { COLOUR_WHITE }); } } @@ -1140,7 +1140,7 @@ public: auto footpathEntry = reinterpret_cast(footpathObj->GetLegacyData()); auto ft = Formatter(); ft.Add(footpathEntry->string_idx); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); } // Path addition @@ -1152,13 +1152,13 @@ public: auto ft = Formatter(); ft.Add(additionNameId); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft, { COLOUR_WHITE }); } else { DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS_NONE, {}, + dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS_NONE, {}, { COLOUR_WHITE }); } @@ -1166,18 +1166,18 @@ public: // Raise / lower label screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_PATH_SPINNER_HEIGHT].top }; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); // Current base height screenCoords.x = windowPos.x + widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3; auto ft = Formatter(); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Path connections screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_PATH_CHECK_EDGE_W].top }; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_PATH_CONNECTED_EDGES, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_CONNECTED_EDGES, {}, { colours[1] }); break; } @@ -1190,7 +1190,7 @@ public: // Ride ID auto ft = Formatter(); ft.Add(id); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { colours[1] }); // Ride name if (rideTile != nullptr) @@ -1198,7 +1198,7 @@ public: ft = Formatter(); rideTile->FormatNameTo(ft); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, { colours[1] }); } @@ -1207,18 +1207,18 @@ public: ft = Formatter(); ft.Add(rtd.Naming.Name); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { colours[1] }); // Track ft = Formatter(); ft.Add(trackElement->GetTrackType()); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, ft, { colours[1] }); ft = Formatter(); ft.Add(trackElement->GetSequenceIndex()); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, ft, { colours[1] }); if (trackElement->IsStation()) { auto stationIndex = trackElement->GetStationIndex(); @@ -1226,7 +1226,7 @@ public: ft.Add(STR_COMMA16); ft.Add(stationIndex.ToUnderlying()); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); } else { @@ -1235,24 +1235,24 @@ public: ft.Add(STR_STRING); ft.Add(stationNone); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); } ft = Formatter(); ft.Add(ColourSchemeNames[trackElement->GetColourScheme()]); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { colours[1] }); // Properties // Raise / lower label screenCoords.y = windowPos.y + widgets[WIDX_TRACK_SPINNER_HEIGHT].top; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); // Current base height screenCoords.x = windowPos.x + widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3; ft = Formatter(); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); break; } @@ -1262,7 +1262,7 @@ public: // Age auto ft = Formatter(); ft.Add(tileElement->AsSmallScenery()->GetAge()); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, ft, { colours[1] }); // Quadrant value const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); @@ -1278,7 +1278,7 @@ public: ft = Formatter(); ft.Add(_quadrantStringIdx[quadrant]); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft, { colours[1] }); } @@ -1286,27 +1286,27 @@ public: ft = Formatter(); ft.Add(tileElement->AsSmallScenery()->GetEntryIndex()); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, ft, { colours[1] }); // Properties // Raise / Lower screenCoords.y = windowPos.y + widgets[WIDX_SCENERY_SPINNER_HEIGHT].top; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); // Current base height screenCoords.x = windowPos.x + widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3; ft = Formatter(); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Quarter tile screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SCENERY_CHECK_QUARTER_E].top }; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_QUADRANT_LABEL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_QUADRANT_LABEL, {}, { colours[1] }); // Collision screenCoords.y = windowPos.y + widgets[WIDX_SCENERY_CHECK_COLLISION_E].top; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_COLLISSION, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_COLLISSION, {}, { colours[1] }); break; } @@ -1316,7 +1316,7 @@ public: // Entrance type auto ft = Formatter(); ft.Add(EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { colours[1] }); if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) { @@ -1324,7 +1324,7 @@ public: ft = Formatter(); ft.Add(ParkEntranceGetIndex({ _toolMap, tileElement->GetBaseZ() })); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, { colours[1] }); } else @@ -1335,14 +1335,14 @@ public: { // Ride entrance ID DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, { colours[1] }); } else { // Ride exit ID DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, ft, { colours[1] }); } } @@ -1353,7 +1353,7 @@ public: ft = Formatter(); ft.Add(ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, { colours[1] }); } else { @@ -1361,7 +1361,7 @@ public: ft = Formatter(); ft.Add(tileElement->AsEntrance()->GetRideIndex()); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft, { colours[1] }); // Station index auto stationIndex = tileElement->AsEntrance()->GetStationIndex(); @@ -1369,19 +1369,19 @@ public: ft.Add(STR_COMMA16); ft.Add(stationIndex.ToUnderlying()); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); + dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); } // Properties // Raise / Lower screenCoords.y = windowPos.y + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); // Current base height screenCoords.x = windowPos.x + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3; ft = Formatter(); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); break; } @@ -1391,7 +1391,7 @@ public: // Type auto ft = Formatter(); ft.Add(tileElement->AsWall()->GetEntryIndex()); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, ft, { colours[1] }); // Banner info auto banner = tileElement->AsWall()->GetBanner(); @@ -1400,35 +1400,35 @@ public: ft = Formatter(); banner->FormatTextTo(ft); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] }); } else { DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {}, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {}, { colours[1] }); } // Properties // Raise / lower label screenCoords.y = windowPos.y + widgets[WIDX_WALL_SPINNER_HEIGHT].top; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); // Current base height screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_HEIGHT].left + 3; ft = Formatter(); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Slope label screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_WALL_DROPDOWN_SLOPE].top }; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_WALL_SLOPE, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_SLOPE, {}, { colours[1] }); // Animation frame label screenCoords.y = windowPos.y + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].top; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, {}, { colours[1] }); // Current animation frame colour_t colour = colours[1]; @@ -1439,7 +1439,7 @@ public: screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].left + 3; ft = Formatter(); ft.Add(tileElement->AsWall()->GetAnimationFrame()); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colour }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colour }); break; } @@ -1451,13 +1451,13 @@ public: ObjectEntryIndex largeSceneryType = sceneryElement->GetEntryIndex(); auto ft = Formatter(); ft.Add(largeSceneryType); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, ft, { colours[1] }); // Part ID ft = Formatter(); ft.Add(sceneryElement->GetSequenceIndex()); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, ft, { colours[1] }); // Banner info @@ -1470,27 +1470,27 @@ public: ft = Formatter(); banner->FormatTextTo(ft); DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] }); } } else { DrawTextBasic( - &dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {}, + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {}, { colours[1] }); } // Properties // Raise / lower label screenCoords.y = windowPos.y + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); // Current base height screenCoords.x = windowPos.x + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3; ft = Formatter(); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); break; } @@ -1503,24 +1503,24 @@ public: { Formatter ft; banner->FormatTextTo(ft); - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] }); } // Properties // Raise / lower label screenCoords.y = windowPos.y + widgets[WIDX_BANNER_SPINNER_HEIGHT].top; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); // Current base height screenCoords.x = windowPos.x + widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3; auto ft = Formatter(); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Blocked paths screenCoords.y += 28; screenCoords.x = windowPos.x + widgets[WIDX_GROUPBOX_DETAILS].left + 7; - DrawTextBasic(&dpi, screenCoords, STR_TILE_INSPECTOR_BANNER_BLOCKED_PATHS, {}, { colours[1] }); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BANNER_BLOCKED_PATHS, {}, { colours[1] }); break; } @@ -1544,7 +1544,7 @@ public: (listWidget.height() - FontGetLineHeight(FontStyle::Medium)) / 2 }; auto ft = Formatter{}; auto textPaint = TextPaint{ colours[1], TextAlignment::CENTRE }; - DrawTextWrapped(&dpi, centrePos, listWidth, STR_TILE_INSPECTOR_SELECT_TILE_HINT, ft, textPaint); + DrawTextWrapped(dpi, centrePos, listWidth, STR_TILE_INSPECTOR_SELECT_TILE_HINT, ft, textPaint); return; } @@ -1586,7 +1586,7 @@ public: auto eyeFormatter = Formatter(); eyeFormatter.Add(STR_STRING); eyeFormatter.Add(EyeString); - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ 2, 1 }, stringFormat, eyeFormatter); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 2, 1 }, stringFormat, eyeFormatter); } const auto type = tileElement->GetType(); @@ -1653,32 +1653,31 @@ public: auto ft = Formatter(); ft.Add(STR_STRING); ft.Add(typeName); - DrawTextEllipsised( - &dpi, screenCoords + ScreenCoordsXY{ TypeColumnXY.x, 0 }, TypeColumnSize.width, stringFormat, ft); + DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ TypeColumnXY.x, 0 }, TypeColumnSize.width, stringFormat, ft); // Base height ft = Formatter(); ft.Add(STR_FORMAT_INTEGER); ft.Add(tileElement->BaseHeight); - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft); // Clearance height ft = Formatter(); ft.Add(STR_FORMAT_INTEGER); ft.Add(clearanceHeight); - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ ClearanceHeightColumnXY.x, 0 }, stringFormat, ft); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ ClearanceHeightColumnXY.x, 0 }, stringFormat, ft); // Direction ft = Formatter(); ft.Add(STR_FORMAT_INTEGER); ft.Add(tileElement->GetDirection()); - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ DirectionColumnXY.x, 0 }, stringFormat, ft); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ DirectionColumnXY.x, 0 }, stringFormat, ft); // Checkmarks for ghost and last for tile if (ghost) - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ GhostFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ GhostFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter); if (last) - DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ LastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter); screenCoords.y -= SCROLLABLE_ROW_HEIGHT; i++; diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index d8a25fb131..12bb804365 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -100,7 +100,7 @@ public: // Text left = windowPos.x + ((width + 1) / 2) - 1; top = windowPos.y + 1; - DrawStringCentredRaw(&dpi, { left, top }, _tooltipNumLines, _tooltipText.data(), FontStyle::Small); + DrawStringCentredRaw(dpi, { left, top }, _tooltipNumLines, _tooltipText.data(), FontStyle::Small); } private: diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 1f47cf1dfd..97cc2a00fa 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -3223,7 +3223,7 @@ public: if (gCheatsDisableClearanceChecks) { DrawTextBasic( - &dpi, screenPos + ScreenCoordsXY{ 26, 2 }, STR_OVERLAY_CLEARANCE_CHECKS_DISABLED, {}, + dpi, screenPos + ScreenCoordsXY{ 26, 2 }, STR_OVERLAY_CLEARANCE_CHECKS_DISABLED, {}, { COLOUR_DARK_ORANGE | COLOUR_FLAG_OUTLINE, TextAlignment::RIGHT }); } } @@ -3288,7 +3288,7 @@ public: auto ft = Formatter(); ft.Add(NetworkGetNumVisiblePlayers()); DrawTextBasic( - &dpi, screenPos + ScreenCoordsXY{ 23, 1 }, STR_COMMA16, ft, + dpi, screenPos + ScreenCoordsXY{ 23, 1 }, STR_COMMA16, ft, { COLOUR_WHITE | COLOUR_FLAG_OUTLINE, TextAlignment::RIGHT }); } } diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 1b79d0401f..aecab10a40 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -230,7 +230,7 @@ void TrackDeletePromptWindow::OnDraw(DrawPixelInfo& dpi) auto ft = Formatter(); ft.Add(_trackDesignFileReference->name.c_str()); DrawTextWrapped( - &dpi, { windowPos.x + (WW_DELETE_PROMPT / 2), windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4), + dpi, { windowPos.x + (WW_DELETE_PROMPT / 2), windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4), STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, ft, { TextAlignment::CENTRE }); } diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 1e98385277..5ea86faf2a 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -308,7 +308,7 @@ public: { ft = Formatter(); ft.Add(_placementCost); - DrawTextBasic(&dpi, this->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, this->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 6384aaf7a3..915d39c038 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -468,7 +468,7 @@ public: auto ft = Formatter(); ft.Add(pathPtr); DrawTextBasic( - &dpi, windowPos + ScreenCoordsXY{ 0, height - DEBUG_PATH_HEIGHT - 3 }, STR_STRING, ft, + dpi, windowPos + ScreenCoordsXY{ 0, height - DEBUG_PATH_HEIGHT - 3 }, STR_STRING, ft, { colours[1] }); // TODO Check dpi } @@ -511,7 +511,7 @@ public: && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { // Vehicle design not available - DrawTextEllipsised(&dpi, screenPos, 368, STR_VEHICLE_DESIGN_UNAVAILABLE, {}, { TextAlignment::CENTRE }); + DrawTextEllipsised(dpi, screenPos, 368, STR_VEHICLE_DESIGN_UNAVAILABLE, {}, { TextAlignment::CENTRE }); screenPos.y -= SCROLLABLE_ROW_HEIGHT; } @@ -521,7 +521,7 @@ public: { // Scenery not available DrawTextEllipsised( - &dpi, screenPos, 368, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); + dpi, screenPos, 368, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); screenPos.y -= SCROLLABLE_ROW_HEIGHT; } } @@ -529,7 +529,7 @@ public: // Track design name auto ft = Formatter(); ft.Add(_trackDesigns[trackIndex].name.c_str()); - DrawTextEllipsised(&dpi, screenPos, 368, STR_TRACK_PREVIEW_NAME_FORMAT, ft, { TextAlignment::CENTRE }); + DrawTextEllipsised(dpi, screenPos, 368, STR_TRACK_PREVIEW_NAME_FORMAT, ft, { TextAlignment::CENTRE }); // Information screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.bottom + 2 }; @@ -537,17 +537,17 @@ public: // Stats ft = Formatter(); ft.Add(_loadedTrackDesign->excitement * 10); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); screenPos.y += LIST_ROW_HEIGHT; ft = Formatter(); ft.Add(_loadedTrackDesign->intensity * 10); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); screenPos.y += LIST_ROW_HEIGHT; ft = Formatter(); ft.Add(_loadedTrackDesign->nausea * 10); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); screenPos.y += LIST_ROW_HEIGHT + 4; // Information for tracked rides. @@ -561,7 +561,7 @@ public: // Holes ft = Formatter(); ft.Add(_loadedTrackDesign->holes & 0x1F); - DrawTextBasic(&dpi, screenPos, STR_HOLES, ft); + DrawTextBasic(dpi, screenPos, STR_HOLES, ft); screenPos.y += LIST_ROW_HEIGHT; } else @@ -569,13 +569,13 @@ public: // Maximum speed ft = Formatter(); ft.Add(((_loadedTrackDesign->max_speed << 16) * 9) >> 18); - DrawTextBasic(&dpi, screenPos, STR_MAX_SPEED, ft); + DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); screenPos.y += LIST_ROW_HEIGHT; // Average speed ft = Formatter(); ft.Add(((_loadedTrackDesign->average_speed << 16) * 9) >> 18); - DrawTextBasic(&dpi, screenPos, STR_AVERAGE_SPEED, ft); + DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -583,7 +583,7 @@ public: ft = Formatter(); ft.Add(STR_RIDE_LENGTH_ENTRY); ft.Add(_loadedTrackDesign->ride_length); - DrawTextEllipsised(&dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); + DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -592,19 +592,19 @@ public: // Maximum positive vertical Gs ft = Formatter(); ft.Add(_loadedTrackDesign->max_positive_vertical_g * 32); - DrawTextBasic(&dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); + DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); screenPos.y += LIST_ROW_HEIGHT; // Maximum negative vertical Gs ft = Formatter(); ft.Add(_loadedTrackDesign->max_negative_vertical_g * 32); - DrawTextBasic(&dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); + DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); screenPos.y += LIST_ROW_HEIGHT; // Maximum lateral Gs ft = Formatter(); ft.Add(_loadedTrackDesign->max_lateral_g * 32); - DrawTextBasic(&dpi, screenPos, STR_MAX_LATERAL_G, ft); + DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); screenPos.y += LIST_ROW_HEIGHT; if (_loadedTrackDesign->total_air_time != 0) @@ -612,7 +612,7 @@ public: // Total air time ft = Formatter(); ft.Add(_loadedTrackDesign->total_air_time * 25); - DrawTextBasic(&dpi, screenPos, STR_TOTAL_AIR_TIME, ft); + DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); screenPos.y += LIST_ROW_HEIGHT; } } @@ -622,13 +622,13 @@ public: // Drops ft = Formatter(); ft.Add(_loadedTrackDesign->drops & 0x3F); - DrawTextBasic(&dpi, screenPos, STR_DROPS, ft); + DrawTextBasic(dpi, screenPos, STR_DROPS, ft); screenPos.y += LIST_ROW_HEIGHT; // Drop height is multiplied by 0.75 ft = Formatter(); ft.Add((_loadedTrackDesign->highest_drop_height * 3) / 4); - DrawTextBasic(&dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); + DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -640,7 +640,7 @@ public: ft = Formatter(); ft.Add(inversions); // Inversions - DrawTextBasic(&dpi, screenPos, STR_INVERSIONS, ft); + DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); screenPos.y += LIST_ROW_HEIGHT; } } @@ -653,7 +653,7 @@ public: ft = Formatter(); ft.Add(_loadedTrackDesign->space_required_x); ft.Add(_loadedTrackDesign->space_required_y); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); screenPos.y += LIST_ROW_HEIGHT; } @@ -661,7 +661,7 @@ public: { ft = Formatter(); ft.Add(_loadedTrackDesign->cost); - DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); } } @@ -677,7 +677,7 @@ public: if (_trackDesigns.empty()) { // No track designs - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE); return; } } @@ -700,7 +700,7 @@ public: auto ft = Formatter(); ft.Add(STR_BUILD_CUSTOM_DESIGN); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); screenCoords.y += SCROLLABLE_ROW_HEIGHT; listIndex++; } @@ -727,7 +727,7 @@ public: auto ft = Formatter(); ft.Add(STR_TRACK_LIST_NAME_FORMAT); ft.Add(_trackDesigns[i].name.c_str()); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); } screenCoords.y += SCROLLABLE_ROW_HEIGHT; diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index ed4e3fa9ac..7c13dda86e 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -278,7 +278,7 @@ public: // Clip height value auto screenCoords = this->windowPos + ScreenCoordsXY{ 8, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; - DrawTextBasic(&dpi, screenCoords, STR_VIEW_CLIPPING_HEIGHT_VALUE, {}, { this->colours[0] }); + DrawTextBasic(dpi, screenCoords, STR_VIEW_CLIPPING_HEIGHT_VALUE, {}, { this->colours[0] }); screenCoords = this->windowPos + ScreenCoordsXY{ this->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; @@ -292,7 +292,7 @@ public: ft.Add(static_cast(gClipHeight)); // Printing the raw value. - DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); break; } case DisplayType::DisplayUnits: @@ -304,7 +304,7 @@ public: auto ft = Formatter(); ft.Add(static_cast(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0))); DrawTextBasic( - &dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft, + dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft, { this->colours[0] }); // Printing the value in Height Units. } else @@ -319,7 +319,7 @@ public: auto ft = Formatter(); ft.Add( static_cast(FIXED_2DP(gClipHeight, 0) / 2 * 1.5f - FIXED_2DP(10, 50))); - DrawTextBasic(&dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { this->colours[0] }); + DrawTextBasic(dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { this->colours[0] }); break; } case MeasurementFormat::Imperial: @@ -327,7 +327,7 @@ public: auto ft = Formatter(); ft.Add( static_cast(FIXED_1DP(gClipHeight, 0) / 2.0f * 5 - FIXED_1DP(35, 0))); - DrawTextBasic(&dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, ft, { this->colours[0] }); + DrawTextBasic(dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, ft, { this->colours[0] }); break; } } diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index a4fca2088c..1fce7975c0 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -149,7 +149,7 @@ public: { auto ft = Formatter(); ft.Add(gLandToolSize); - DrawTextBasic(&dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); } if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) @@ -161,7 +161,7 @@ public: { auto ft = Formatter(); ft.Add(gWaterToolRaiseCost); - DrawTextBasic(&dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } screenCoords.y += 10; @@ -170,7 +170,7 @@ public: { auto ft = Formatter(); ft.Add(gWaterToolLowerCost); - DrawTextBasic(&dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } } diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index df491c909c..e96d5e3eb2 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -273,7 +273,7 @@ int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8 /** * Draws text that is left aligned and vertically centred. */ -void GfxDrawStringLeftCentred(DrawPixelInfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords) +void GfxDrawStringLeftCentred(DrawPixelInfo& dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords) { char buffer[CommonTextBufferSize]; auto bufferPtr = buffer; @@ -338,9 +338,9 @@ static void ColourCharacterWindow(uint8_t colour, const uint16_t* current_font_f * dpi : edi */ void DrawStringCentredRaw( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle) + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle) { - ScreenCoordsXY screenCoords(dpi->x, dpi->y); + ScreenCoordsXY screenCoords(dpi.x, dpi.y); GfxDrawString(dpi, screenCoords, "", { COLOUR_BLACK, fontStyle }); screenCoords = coords; @@ -433,11 +433,11 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle) * ticks : ebp >> 16 */ void DrawNewsTicker( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, u8string_view args, + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, u8string_view args, int32_t ticks) { int32_t numLines, lineHeight, lineY; - ScreenCoordsXY screenCoords(dpi->x, dpi->y); + ScreenCoordsXY screenCoords(dpi.x, dpi.y); GfxDrawString(dpi, screenCoords, "", { colour }); @@ -504,7 +504,7 @@ struct TextDrawInfo const int8_t* y_offset; }; -static void TTFDrawCharacterSprite(DrawPixelInfo* dpi, int32_t codepoint, TextDrawInfo* info) +static void TTFDrawCharacterSprite(DrawPixelInfo& dpi, int32_t codepoint, TextDrawInfo* info) { int32_t characterWidth = FontSpriteGetCodepointWidth(info->FontStyle, codepoint); auto sprite = FontSpriteGetCodepointSprite(info->FontStyle, codepoint); @@ -518,13 +518,13 @@ static void TTFDrawCharacterSprite(DrawPixelInfo* dpi, int32_t codepoint, TextDr } PaletteMap paletteMap(info->palette); - GfxDrawGlyph(dpi, sprite, screenCoords, paletteMap); + GfxDrawGlyph(&dpi, sprite, screenCoords, paletteMap); } info->x += characterWidth; } -static void TTFDrawStringRawSprite(DrawPixelInfo* dpi, std::string_view text, TextDrawInfo* info) +static void TTFDrawStringRawSprite(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info) { CodepointView codepoints(text); for (auto codepoint : codepoints) @@ -536,7 +536,7 @@ static void TTFDrawStringRawSprite(DrawPixelInfo* dpi, std::string_view text, Te #ifndef NO_TTF static int _ttfGlId = 0; -static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextDrawInfo* info) +static void TTFDrawStringRawTTF(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info) { if (!TTFInitialise()) return; @@ -582,10 +582,10 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD auto baseId = uint32_t(0x7FFFF) - 1024; auto imageId = baseId + _ttfGlId; - auto drawingEngine = dpi->DrawingEngine; + auto drawingEngine = dpi.DrawingEngine; auto drawingContext = drawingEngine->GetDrawingContext(); drawingEngine->InvalidateImage(imageId); - drawingContext->DrawBitmap(dpi, imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY); + drawingContext->DrawBitmap(&dpi, imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY); _ttfGlId++; if (_ttfGlId >= 1023) @@ -595,18 +595,18 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD return; } - int32_t overflowX = (dpi->x + dpi->width) - (drawX + width); - int32_t overflowY = (dpi->y + dpi->height) - (drawY + height); + int32_t overflowX = (dpi.x + dpi.width) - (drawX + width); + int32_t overflowY = (dpi.y + dpi.height) - (drawY + height); if (overflowX < 0) width += overflowX; if (overflowY < 0) height += overflowY; - int32_t skipX = drawX - dpi->x; - int32_t skipY = drawY - dpi->y; + int32_t skipX = drawX - dpi.x; + int32_t skipY = drawY - dpi.y; info->x += width; auto src = static_cast(surface->pixels); - uint8_t* dst = dpi->bits; + uint8_t* dst = dpi.bits; if (skipX < 0) { @@ -622,10 +622,10 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD } dst += skipX; - dst += skipY * (dpi->width + dpi->pitch); + dst += skipY * (dpi.width + dpi.pitch); int32_t srcScanSkip = surface->pitch - width; - int32_t dstScanSkip = dpi->width + dpi->pitch - width; + int32_t dstScanSkip = dpi.width + dpi.pitch - width; uint8_t* dst_orig = dst; const uint8_t* src_orig = src; @@ -639,7 +639,7 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD if (*src != 0) { // right - if (xx + skipX < dpi->width + dpi->pitch - 1) + if (xx + skipX < dpi.width + dpi.pitch - 1) { *(dst + 1) = info->palette[3]; } @@ -654,7 +654,7 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD *(dst - width - dstScanSkip) = info->palette[3]; } // bottom - if (yy + skipY < dpi->height - 1) + if (yy + skipY < dpi.height - 1) { *(dst + width + dstScanSkip) = info->palette[3]; } @@ -712,7 +712,7 @@ static void TTFDrawStringRawTTF(DrawPixelInfo* dpi, std::string_view text, TextD #endif // NO_TTF -static void TTFProcessFormatCode(DrawPixelInfo* dpi, const FmtString::Token& token, TextDrawInfo* info) +static void TTFProcessFormatCode(DrawPixelInfo& dpi, const FmtString::Token& token, TextDrawInfo* info) { switch (token.kind) { @@ -768,7 +768,7 @@ static void TTFProcessFormatCode(DrawPixelInfo* dpi, const FmtString::Token& tok { if (!(info->flags & TEXT_DRAW_FLAG_NO_DRAW)) { - GfxDrawSprite(dpi, imageId, { info->x, info->y }); + GfxDrawSprite(&dpi, imageId, { info->x, info->y }); } info->x += g1->width; } @@ -816,7 +816,7 @@ static bool ShouldUseSpriteForCodepoint(char32_t codepoint) } #endif // NO_TTF -static void TTFProcessStringLiteral(DrawPixelInfo* dpi, std::string_view text, TextDrawInfo* info) +static void TTFProcessStringLiteral(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info) { #ifndef NO_TTF bool isTTF = info->flags & TEXT_DRAW_FLAG_TTF; @@ -878,14 +878,14 @@ static void TTFProcessStringLiteral(DrawPixelInfo* dpi, std::string_view text, T #endif // NO_TTF } -static void TTFProcessStringCodepoint(DrawPixelInfo* dpi, codepoint_t codepoint, TextDrawInfo* info) +static void TTFProcessStringCodepoint(DrawPixelInfo& dpi, codepoint_t codepoint, TextDrawInfo* info) { char buffer[8]{}; UTF8WriteCodepoint(buffer, codepoint); TTFProcessStringLiteral(dpi, buffer, info); } -static void TTFProcessString(DrawPixelInfo* dpi, std::string_view text, TextDrawInfo* info) +static void TTFProcessString(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info) { if (info->flags & TEXT_DRAW_FLAG_NO_FORMATTING) { @@ -973,7 +973,7 @@ static void TTFProcessInitialColour(int32_t colour, TextDrawInfo* info) } void TTFDrawString( - DrawPixelInfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting, + DrawPixelInfo& dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting, FontStyle fontStyle, TextDarkness darkness) { if (text == nullptr) @@ -1011,7 +1011,7 @@ void TTFDrawString( TTFProcessString(dpi, text, &info); std::memcpy(gTextPalette, info.palette, sizeof(info.palette)); - dpi->lastStringPos = { info.x, info.y }; + dpi.lastStringPos = { info.x, info.y }; } static int32_t TTFGetStringWidth(std::string_view text, FontStyle fontStyle, bool noFormatting) @@ -1037,7 +1037,8 @@ static int32_t TTFGetStringWidth(std::string_view text, FontStyle fontStyle, boo info.flags |= TEXT_DRAW_FLAG_NO_FORMATTING; } - TTFProcessString(nullptr, text, &info); + DrawPixelInfo dummy{}; + TTFProcessString(dummy, text, &info); return info.maxX; } @@ -1047,7 +1048,7 @@ static int32_t TTFGetStringWidth(std::string_view text, FontStyle fontStyle, boo * rct2: 0x00682F28 */ void GfxDrawStringWithYOffsets( - DrawPixelInfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets, + DrawPixelInfo& dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets, bool forceSpriteFont, FontStyle fontStyle) { TextDrawInfo info; @@ -1071,7 +1072,7 @@ void GfxDrawStringWithYOffsets( TTFProcessString(dpi, text, &info); std::memcpy(gTextPalette, info.palette, sizeof(info.palette)); - dpi->lastStringPos = { info.x, info.y }; + dpi.lastStringPos = { info.x, info.y }; } void ShortenPath(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle) diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 87fa181952..075d13a42b 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -520,16 +520,16 @@ void FASTCALL GfxDrawSpriteRawMaskedSoftware( DrawPixelInfo* dpi, const ScreenCoordsXY& scrCoords, const ImageId maskImage, const ImageId colourImage); // string -void GfxDrawString(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint = {}); +void GfxDrawString(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint = {}); -void GfxDrawStringLeftCentred(DrawPixelInfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords); +void GfxDrawStringLeftCentred(DrawPixelInfo& dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords); void DrawStringCentredRaw( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle); + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t numLines, const utf8* text, FontStyle fontStyle); void DrawNewsTicker( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, u8string_view args, + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, u8string_view args, int32_t ticks); void GfxDrawStringWithYOffsets( - DrawPixelInfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets, + DrawPixelInfo& dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets, bool forceSpriteFont, FontStyle fontStyle); int32_t GfxWrapString(u8string_view text, int32_t width, FontStyle fontStyle, u8string* outWrappedText, int32_t* outNumLines); @@ -540,7 +540,7 @@ int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle); int32_t GfxClipString(char* buffer, int32_t width, FontStyle fontStyle); void ShortenPath(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle); void TTFDrawString( - DrawPixelInfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting, + DrawPixelInfo& dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting, FontStyle fontStyle, TextDarkness darkness); // scrolling text diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index 5095bdc3f5..aaf97f0822 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -32,7 +32,7 @@ public: LineHeight = FontGetLineHeight(paint.FontStyle); } - void Draw(DrawPixelInfo* dpi, const ScreenCoordsXY& coords) + void Draw(DrawPixelInfo& dpi, const ScreenCoordsXY& coords) { TextPaint tempPaint = Paint; @@ -75,7 +75,7 @@ public: }; void DrawText( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting) + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting) { int32_t width = noFormatting ? GfxGetStringWidthNoFormatting(text, paint.FontStyle) : GfxGetStringWidth(text, paint.FontStyle); @@ -98,32 +98,32 @@ void DrawText( if (paint.UnderlineText == TextUnderline::On) { GfxFillRect( - dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } }, + &dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } }, gTextPalette[1]); if (gTextPalette[2] != 0) { GfxFillRect( - dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } }, + &dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } }, gTextPalette[2]); } } } -void DrawTextBasic(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, StringId format) +void DrawTextBasic(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, StringId format) { Formatter ft{}; TextPaint textPaint{}; DrawTextBasic(dpi, coords, format, ft, textPaint); } -void DrawTextBasic(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint) +void DrawTextBasic(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint) { utf8 buffer[512]; OpenRCT2::FormatStringLegacy(buffer, sizeof(buffer), format, ft.Data()); DrawText(dpi, coords, textPaint, buffer); } -void DrawTextEllipsised(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format) +void DrawTextEllipsised(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format) { Formatter ft{}; TextPaint textPaint{}; @@ -131,7 +131,7 @@ void DrawTextEllipsised(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_ } void DrawTextEllipsised( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint) + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint) { utf8 buffer[512]; OpenRCT2::FormatStringLegacy(buffer, sizeof(buffer), format, ft.Data()); @@ -140,12 +140,12 @@ void DrawTextEllipsised( DrawText(dpi, coords, textPaint, buffer); } -void GfxDrawString(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint) +void GfxDrawString(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint) { DrawText(dpi, coords, textPaint, buffer); } -int32_t DrawTextWrapped(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format) +int32_t DrawTextWrapped(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format) { Formatter ft{}; TextPaint textPaint{}; @@ -153,7 +153,7 @@ int32_t DrawTextWrapped(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_ } int32_t DrawTextWrapped( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint) + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint) { const void* args = ft.Data(); diff --git a/src/openrct2/drawing/Text.h b/src/openrct2/drawing/Text.h index 422f051723..68fb0b0ddb 100644 --- a/src/openrct2/drawing/Text.h +++ b/src/openrct2/drawing/Text.h @@ -142,17 +142,17 @@ struct TextPaint } }; -void DrawTextBasic(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, StringId format); -void DrawTextEllipsised(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format); -int32_t DrawTextWrapped(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format); +void DrawTextBasic(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, StringId format); +void DrawTextEllipsised(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format); +int32_t DrawTextWrapped(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format); void DrawText( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting = false); + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting = false); void DrawTextBasic( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint = {}); + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, StringId format, const Formatter& ft, TextPaint textPaint = {}); void DrawTextEllipsised( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint = {}); int32_t DrawTextWrapped( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t width, StringId format, const Formatter& ft, TextPaint textPaint = {}); diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index e6d0d3cd15..642948a05e 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -193,7 +193,7 @@ void ChatDraw(DrawPixelInfo* dpi, uint8_t chatBackgroundColor) auto ft = Formatter(); ft.Add(lineCh); inputLineHeight = DrawTextWrapped( - dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { TEXT_COLOUR_255 }); + *dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, _chatWidth - 10, STR_STRING, ft, { TEXT_COLOUR_255 }); GfxSetDirtyBlocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } }); // TODO: Show caret if the input text has multiple lines @@ -289,7 +289,7 @@ static int32_t ChatHistoryDrawString(DrawPixelInfo* dpi, const char* text, const int32_t lineY = screenCoords.y; for (int32_t line = 0; line <= numLines; ++line) { - GfxDrawString(dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, bufferPtr, { TEXT_COLOUR_254 }); + GfxDrawString(*dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, bufferPtr, { TEXT_COLOUR_254 }); bufferPtr = GetStringEnd(bufferPtr) + 1; lineY += lineHeight; } diff --git a/src/openrct2/object/MusicObject.cpp b/src/openrct2/object/MusicObject.cpp index 56ba4fa2a2..8e029bb90d 100644 --- a/src/openrct2/object/MusicObject.cpp +++ b/src/openrct2/object/MusicObject.cpp @@ -95,7 +95,7 @@ void MusicObject::DrawPreview(DrawPixelInfo* dpi, int32_t width, int32_t height) if (_hasPreview) GfxDrawSprite(dpi, ImageId(_previewImageId), { 0, 0 }); else - DrawTextBasic(dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE }); + DrawTextBasic(*dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE }); } void MusicObject::ReadJson(IReadObjectContext* context, json_t& root) diff --git a/src/openrct2/object/WaterObject.cpp b/src/openrct2/object/WaterObject.cpp index bdb6d75321..cebed8bb37 100644 --- a/src/openrct2/object/WaterObject.cpp +++ b/src/openrct2/object/WaterObject.cpp @@ -58,7 +58,7 @@ void WaterObject::DrawPreview(DrawPixelInfo* dpi, int32_t width, int32_t height) { // Write (no image) auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 }; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE }); + DrawTextBasic(*dpi, screenCoords, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE }); } void WaterObject::ReadJson([[maybe_unused]] IReadObjectContext* context, json_t& root) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 07232dfd99..2d46c98d36 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -893,7 +893,7 @@ void PaintDrawMoneyStructs(DrawPixelInfo* dpi, PaintStringStruct* ps) } GfxDrawStringWithYOffsets( - dpi, buffer, COLOUR_BLACK, { ps->x, ps->y }, reinterpret_cast(ps->y_offsets), forceSpriteFont, + *dpi, buffer, COLOUR_BLACK, { ps->x, ps->y }, reinterpret_cast(ps->y_offsets), forceSpriteFont, FontStyle::Medium); } while ((ps = ps->next) != nullptr); } diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index af1868af74..10ba29580e 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -94,7 +94,7 @@ void Painter::PaintReplayNotice(DrawPixelInfo* dpi, const char* text) screenCoords.x = screenCoords.x - stringWidth; if (((gCurrentTicks >> 1) & 0xF) > 4) - GfxDrawString(dpi, screenCoords, buffer, { COLOUR_SATURATED_RED }); + GfxDrawString(*dpi, screenCoords, buffer, { COLOUR_SATURATED_RED }); // Make area dirty so the text doesn't get drawn over the last GfxSetDirtyBlocks({ screenCoords, screenCoords + ScreenCoordsXY{ stringWidth, 16 } }); @@ -112,7 +112,7 @@ void Painter::PaintFPS(DrawPixelInfo* dpi) // Draw Text int32_t stringWidth = GfxGetStringWidth(buffer, FontStyle::Medium); screenCoords.x = screenCoords.x - (stringWidth / 2); - GfxDrawString(dpi, screenCoords, buffer); + GfxDrawString(*dpi, screenCoords, buffer); // Make area dirty so the text doesn't get drawn over the last GfxSetDirtyBlocks({ { screenCoords - ScreenCoordsXY{ 16, 4 } }, { dpi->lastStringPos.x + 16, 16 } }); diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index e3fe69a343..e8188b0943 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -448,7 +448,7 @@ void DrawOpenRCT2(DrawPixelInfo* dpi, const ScreenCoordsXY& screenCoords) // Write name and version information buffer += gVersionInfoFull; - GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 5 - 13), buffer.c_str(), { COLOUR_BLACK }); + GfxDrawString(*dpi, screenCoords + ScreenCoordsXY(5, 5 - 13), buffer.c_str(), { COLOUR_BLACK }); // Invalidate screen area int16_t width = static_cast(GfxGetStringWidth(buffer, FontStyle::Medium)); @@ -461,5 +461,5 @@ void DrawOpenRCT2(DrawPixelInfo* dpi, const ScreenCoordsXY& screenCoords) buffer.append(" ("); buffer.append(OPENRCT2_ARCHITECTURE); buffer.append(")"); - GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 5), buffer.c_str(), { COLOUR_BLACK }); + GfxDrawString(*dpi, screenCoords + ScreenCoordsXY(5, 5), buffer.c_str(), { COLOUR_BLACK }); }