mirror of https://github.com/OpenRCT2/OpenRCT2.git
Using dpi refs in most remaining window defs
This commit is contained in:
parent
9c2d5b9fef
commit
96d77ed8f7
|
@ -325,7 +325,7 @@ public:
|
|||
_drawingContext->CalculcateClipping(&_bitsDPI);
|
||||
|
||||
WindowUpdateAllViewports();
|
||||
WindowDrawAll(&_bitsDPI, 0, 0, _width, _height);
|
||||
WindowDrawAll(_bitsDPI, 0, 0, _width, _height);
|
||||
}
|
||||
|
||||
void PaintWeather() override
|
||||
|
|
|
@ -722,7 +722,7 @@ static void WidgetScrollDraw(DrawPixelInfo* dpi, WindowBase& w, WidgetIndex widg
|
|||
|
||||
// Draw the scroll contents
|
||||
if (scroll_dpi.width > 0 && scroll_dpi.height > 0)
|
||||
WindowEventScrollPaintCall(&w, &scroll_dpi, scrollIndex);
|
||||
WindowEventScrollPaintCall(&w, scroll_dpi, scrollIndex);
|
||||
}
|
||||
|
||||
static void WidgetHScrollbarDraw(
|
||||
|
|
|
@ -629,14 +629,14 @@ void WindowInitScrollWidgets(WindowBase& w)
|
|||
*
|
||||
* rct2: 0x006EB15C
|
||||
*/
|
||||
void WindowDrawWidgets(WindowBase& w, DrawPixelInfo* dpi)
|
||||
void WindowDrawWidgets(WindowBase& w, DrawPixelInfo& dpi)
|
||||
{
|
||||
Widget* widget;
|
||||
WidgetIndex widgetIndex;
|
||||
|
||||
if ((w.flags & WF_TRANSPARENT) && !(w.flags & WF_NO_BACKGROUND))
|
||||
GfxFilterRect(
|
||||
dpi, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, FilterPaletteID::Palette51);
|
||||
&dpi, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, FilterPaletteID::Palette51);
|
||||
|
||||
// todo: some code missing here? Between 006EB18C and 006EB260
|
||||
|
||||
|
@ -646,14 +646,14 @@ void WindowDrawWidgets(WindowBase& w, DrawPixelInfo* dpi)
|
|||
if (widget->IsVisible())
|
||||
{
|
||||
// Check if widget is outside the draw region
|
||||
if (w.windowPos.x + widget->left < dpi->x + dpi->width && w.windowPos.x + widget->right >= dpi->x)
|
||||
if (w.windowPos.x + widget->left < dpi.x + dpi.width && w.windowPos.x + widget->right >= dpi.x)
|
||||
{
|
||||
if (w.windowPos.y + widget->top < dpi->y + dpi->height && w.windowPos.y + widget->bottom >= dpi->y)
|
||||
if (w.windowPos.y + widget->top < dpi.y + dpi.height && w.windowPos.y + widget->bottom >= dpi.y)
|
||||
{
|
||||
if (w.IsLegacy())
|
||||
WidgetDraw(dpi, w, widgetIndex);
|
||||
WidgetDraw(&dpi, w, widgetIndex);
|
||||
else
|
||||
w.OnDrawWidget(widgetIndex, *dpi);
|
||||
w.OnDrawWidget(widgetIndex, dpi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -665,7 +665,7 @@ void WindowDrawWidgets(WindowBase& w, DrawPixelInfo* dpi)
|
|||
if (w.flags & WF_WHITE_BORDER_MASK)
|
||||
{
|
||||
GfxFillRectInset(
|
||||
dpi, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, COLOUR_WHITE,
|
||||
&dpi, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, COLOUR_WHITE,
|
||||
INSET_RECT_FLAG_FILL_NONE);
|
||||
}
|
||||
}
|
||||
|
@ -710,7 +710,7 @@ bool Window::IsLegacy()
|
|||
|
||||
void Window::OnDraw(DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
}
|
||||
|
||||
void Window::OnDrawWidget(WidgetIndex widgetIndex, DrawPixelInfo& dpi)
|
||||
|
@ -760,7 +760,7 @@ void Window::SetCheckboxValue(WidgetIndex widgetIndex, bool value)
|
|||
|
||||
void Window::DrawWidgets(DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
}
|
||||
|
||||
void Window::Close()
|
||||
|
|
|
@ -530,14 +530,14 @@ namespace OpenRCT2::Ui::Windows
|
|||
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
DrawTabImages(dpi);
|
||||
if (viewport != nullptr)
|
||||
{
|
||||
auto widgetIndex = GetViewportWidgetIndex();
|
||||
if (WidgetIsVisible(*this, widgetIndex.value_or(false)))
|
||||
{
|
||||
WindowDrawViewport(&dpi, *this);
|
||||
WindowDrawViewport(dpi, *this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -262,7 +262,7 @@ public:
|
|||
|
||||
if (viewport != nullptr)
|
||||
{
|
||||
WindowDrawViewport(&dpi, *this);
|
||||
WindowDrawViewport(dpi, *this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
|
||||
auto currentRide = GetRide(rideId);
|
||||
if (currentRide != nullptr)
|
||||
|
|
|
@ -1073,8 +1073,8 @@ public:
|
|||
DrawTextEllipsised(dpi, screenPos, _width, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE });
|
||||
}
|
||||
|
||||
DrawDescriptions(&dpi);
|
||||
DrawDebugData(&dpi);
|
||||
DrawDescriptions(dpi);
|
||||
DrawDebugData(dpi);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -1185,7 +1185,7 @@ private:
|
|||
_listItems.shrink_to_fit();
|
||||
}
|
||||
|
||||
void DrawDescriptions(DrawPixelInfo* dpi)
|
||||
void DrawDescriptions(DrawPixelInfo& dpi)
|
||||
{
|
||||
const auto& widget = widgets[WIDX_PREVIEW];
|
||||
auto screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_LIST].right + 4, widget.bottom + 23 };
|
||||
|
@ -1194,7 +1194,7 @@ private:
|
|||
if (_loadedObject->IsCompatibilityObject())
|
||||
{
|
||||
screenPos.y += DrawTextWrapped(
|
||||
*dpi, screenPos, _width2, STR_OBJECT_SELECTION_COMPAT_OBJECT_DESCRIPTION, {},
|
||||
dpi, screenPos, _width2, STR_OBJECT_SELECTION_COMPAT_OBJECT_DESCRIPTION, {},
|
||||
{ COLOUR_BRIGHT_RED })
|
||||
+ LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
@ -1206,7 +1206,7 @@ private:
|
|||
ft.Add<StringId>(STR_STRING);
|
||||
ft.Add<const char*>(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)
|
||||
{
|
||||
|
@ -1227,7 +1227,7 @@ private:
|
|||
}
|
||||
auto ft = Formatter();
|
||||
ft.Add<const char*>(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)
|
||||
|
@ -1235,11 +1235,11 @@ private:
|
|||
const auto* sceneryGroupObject = reinterpret_cast<SceneryGroupObject*>(_loadedObject.get());
|
||||
auto ft = Formatter();
|
||||
ft.Add<uint16_t>(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<MusicObject*>(_loadedObject.get());
|
||||
for (size_t i = 0; i < musicObject->GetTrackCount(); i++)
|
||||
{
|
||||
|
@ -1252,12 +1252,12 @@ private:
|
|||
auto ft = Formatter();
|
||||
ft.Add<const char*>(track->Name.c_str());
|
||||
ft.Add<const char*>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawDebugData(DrawPixelInfo* dpi)
|
||||
void DrawDebugData(DrawPixelInfo& dpi)
|
||||
{
|
||||
ObjectListItem* listItem = &_listItems[selected_list_item];
|
||||
auto screenPos = windowPos + ScreenCoordsXY{ width - 5, height - (LIST_ROW_HEIGHT * 6) };
|
||||
|
@ -1265,7 +1265,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;
|
||||
|
||||
|
@ -1273,14 +1273,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
|
||||
|
@ -1290,7 +1290,7 @@ private:
|
|||
ft.Add<StringId>(STR_STRING);
|
||||
ft.Add<const utf8*>(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;
|
||||
}
|
||||
|
@ -1310,7 +1310,7 @@ private:
|
|||
ft.Add<StringId>(STR_STRING);
|
||||
ft.Add<const char*>(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 });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,10 +210,10 @@ public:
|
|||
switch (page)
|
||||
{
|
||||
case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN:
|
||||
OnDrawMain(&dpi);
|
||||
OnDrawMain(dpi);
|
||||
break;
|
||||
case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES:
|
||||
OnDrawRides(&dpi);
|
||||
OnDrawRides(dpi);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ private:
|
|||
ResizeFrameWithPage();
|
||||
}
|
||||
|
||||
void DrawTabImages(DrawPixelInfo* dpi)
|
||||
void DrawTabImages(DrawPixelInfo& dpi)
|
||||
{
|
||||
Widget* widget;
|
||||
int32_t spriteIndex;
|
||||
|
@ -344,7 +344,7 @@ private:
|
|||
if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN)
|
||||
spriteIndex += (frame_no / 4) % 16;
|
||||
|
||||
GfxDrawSprite(*dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
|
||||
GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
|
||||
|
||||
// Tab 2
|
||||
if (!IsWidgetDisabled(WIDX_TAB_2))
|
||||
|
@ -354,7 +354,7 @@ private:
|
|||
if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES)
|
||||
spriteIndex += (frame_no / 4) % 16;
|
||||
|
||||
GfxDrawSprite(*dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
|
||||
GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -835,23 +835,23 @@ private:
|
|||
*
|
||||
* rct2: 0x0067161C
|
||||
*/
|
||||
void OnDrawMain(DrawPixelInfo* dpi)
|
||||
void OnDrawMain(DrawPixelInfo& dpi)
|
||||
{
|
||||
int32_t widthToSet;
|
||||
StringId stringId;
|
||||
|
||||
DrawWidgets(*dpi);
|
||||
DrawWidgets(dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
// Objective label
|
||||
auto screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_OBJECTIVE].top };
|
||||
DrawTextBasic(*dpi, screenCoords, STR_OBJECTIVE_WINDOW);
|
||||
DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_WINDOW);
|
||||
|
||||
// Objective value
|
||||
screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE].left + 1, widgets[WIDX_OBJECTIVE].top };
|
||||
auto ft = Formatter();
|
||||
ft.Add<StringId>(ObjectiveDropdownOptionNames[gScenarioObjective.Type]);
|
||||
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
|
||||
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
|
||||
|
||||
if (widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty)
|
||||
{
|
||||
|
@ -880,7 +880,7 @@ private:
|
|||
stringId = STR_WINDOW_OBJECTIVE_EXCITEMENT_RATING;
|
||||
break;
|
||||
}
|
||||
DrawTextBasic(*dpi, screenCoords, stringId);
|
||||
DrawTextBasic(dpi, screenCoords, stringId);
|
||||
|
||||
// Objective argument 1 value
|
||||
screenCoords = windowPos
|
||||
|
@ -913,21 +913,21 @@ private:
|
|||
ft.Add<money64>(gScenarioObjective.Currency);
|
||||
break;
|
||||
}
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft, COLOUR_BLACK);
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft, COLOUR_BLACK);
|
||||
}
|
||||
|
||||
if (widgets[WIDX_OBJECTIVE_ARG_2].type != WindowWidgetType::Empty)
|
||||
{
|
||||
// Objective argument 2 label
|
||||
screenCoords = windowPos + ScreenCoordsXY{ 28, 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 = windowPos
|
||||
+ ScreenCoordsXY{ widgets[WIDX_OBJECTIVE_ARG_2].left + 1, widgets[WIDX_OBJECTIVE_ARG_2].top };
|
||||
ft = Formatter();
|
||||
ft.Add<uint16_t>((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
|
||||
|
@ -941,7 +941,7 @@ private:
|
|||
ft = Formatter();
|
||||
ft.Add<StringId>(STR_STRING);
|
||||
ft.Add<const char*>(parkName);
|
||||
DrawTextEllipsised(*dpi, screenCoords, widthToSet, STR_WINDOW_PARK_NAME, ft);
|
||||
DrawTextEllipsised(dpi, screenCoords, widthToSet, STR_WINDOW_PARK_NAME, ft);
|
||||
}
|
||||
|
||||
// Scenario name
|
||||
|
@ -951,11 +951,11 @@ private:
|
|||
ft = Formatter();
|
||||
ft.Add<StringId>(STR_STRING);
|
||||
ft.Add<const char*>(gScenarioName.c_str());
|
||||
DrawTextEllipsised(*dpi, screenCoords, widthToSet, STR_WINDOW_SCENARIO_NAME, ft);
|
||||
DrawTextEllipsised(dpi, screenCoords, widthToSet, STR_WINDOW_SCENARIO_NAME, ft);
|
||||
|
||||
// Scenario details label
|
||||
screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_DETAILS].top };
|
||||
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_PARK_DETAILS);
|
||||
DrawTextBasic(dpi, screenCoords, STR_WINDOW_PARK_DETAILS);
|
||||
|
||||
// Scenario details value
|
||||
screenCoords = windowPos + ScreenCoordsXY{ 16, widgets[WIDX_DETAILS].top + 10 };
|
||||
|
@ -964,17 +964,17 @@ private:
|
|||
ft = Formatter();
|
||||
ft.Add<StringId>(STR_STRING);
|
||||
ft.Add<const char*>(gScenarioDetails.c_str());
|
||||
DrawTextWrapped(*dpi, screenCoords, widthToSet, STR_BLACK_STRING, ft);
|
||||
DrawTextWrapped(dpi, screenCoords, widthToSet, STR_BLACK_STRING, ft);
|
||||
|
||||
// Scenario category label
|
||||
screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_CATEGORY].top };
|
||||
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_SCENARIO_GROUP);
|
||||
DrawTextBasic(dpi, screenCoords, STR_WINDOW_SCENARIO_GROUP);
|
||||
|
||||
// Scenario category value
|
||||
screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_CATEGORY].left + 1, widgets[WIDX_CATEGORY].top };
|
||||
ft = Formatter();
|
||||
ft.Add<StringId>(ScenarioCategoryStringIds[gScenarioCategory]);
|
||||
DrawTextBasic(*dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
|
||||
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
@ -1094,40 +1094,40 @@ private:
|
|||
*
|
||||
* rct2: 0x00672340
|
||||
*/
|
||||
void OnDrawRides(DrawPixelInfo* dpi)
|
||||
void OnDrawRides(DrawPixelInfo& dpi)
|
||||
{
|
||||
DrawWidgets(*dpi);
|
||||
DrawWidgets(dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
DrawTextBasic(
|
||||
*dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PAGE_BACKGROUND].top + 3 }, STR_WINDOW_PRESERVATION_ORDER);
|
||||
dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PAGE_BACKGROUND].top + 3 }, STR_WINDOW_PRESERVATION_ORDER);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0067236F
|
||||
*/
|
||||
void OnScrollDrawRides(DrawPixelInfo* dpi, int32_t scrollIndex)
|
||||
void OnScrollDrawRides(DrawPixelInfo& dpi, int32_t scrollIndex)
|
||||
{
|
||||
int32_t colour = ColourMapA[colours[1]].mid_light;
|
||||
GfxFillRect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width - 1, dpi->y + dpi->height - 1 } }, colour);
|
||||
GfxFillRect(&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour);
|
||||
|
||||
for (int32_t i = 0; i < no_list_items; i++)
|
||||
{
|
||||
int32_t y = i * 12;
|
||||
|
||||
if (y + 12 < dpi->y || y >= dpi->y + dpi->height)
|
||||
if (y + 12 < dpi.y || y >= dpi.y + dpi.height)
|
||||
continue;
|
||||
|
||||
// Checkbox
|
||||
GfxFillRectInset(dpi, { { 2, y }, { 11, y + 10 } }, colours[1], INSET_RECT_F_E0);
|
||||
GfxFillRectInset(&dpi, { { 2, y }, { 11, y + 10 } }, colours[1], INSET_RECT_F_E0);
|
||||
|
||||
// Highlighted
|
||||
auto stringId = STR_BLACK_STRING;
|
||||
if (i == selected_list_item)
|
||||
{
|
||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
GfxFilterRect(dpi, { 0, y, width, y + 11 }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(&dpi, { 0, y, width, y + 11 }, FilterPaletteID::PaletteDarken1);
|
||||
}
|
||||
|
||||
// Checkbox mark
|
||||
|
@ -1139,7 +1139,7 @@ private:
|
|||
{
|
||||
auto darkness = stringId == STR_WINDOW_COLOUR_2_STRINGID ? TextDarkness::ExtraDark : TextDarkness::Dark;
|
||||
GfxDrawString(
|
||||
*dpi, { 2, y }, static_cast<const char*>(CheckBoxMarkString),
|
||||
dpi, { 2, y }, static_cast<const char*>(CheckBoxMarkString),
|
||||
{ static_cast<colour_t>(colours[1] & 0x7F), FontStyle::Medium, darkness });
|
||||
}
|
||||
|
||||
|
@ -1147,7 +1147,7 @@ private:
|
|||
|
||||
Formatter ft;
|
||||
currentRide->FormatNameTo(ft);
|
||||
DrawTextBasic(*dpi, { 15, y }, stringId, ft);
|
||||
DrawTextBasic(dpi, { 15, y }, stringId, ft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -613,7 +613,7 @@ private:
|
|||
{
|
||||
ScreenCoordsXY screenCoords{};
|
||||
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
const auto& initialCashWidget = widgets[WIDX_INITIAL_CASH];
|
||||
|
@ -861,7 +861,7 @@ private:
|
|||
{
|
||||
ScreenCoordsXY screenCoords{};
|
||||
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
const auto& cashPerGuestWidget = widgets[WIDX_CASH_PER_GUEST];
|
||||
|
@ -1180,7 +1180,7 @@ private:
|
|||
{
|
||||
ScreenCoordsXY screenCoords{};
|
||||
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
const auto& landCostWidget = widgets[WIDX_LAND_COST];
|
||||
|
|
|
@ -988,7 +988,7 @@ public:
|
|||
|
||||
void OnDrawResearch(DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowResearchFundingPagePaint(this, &dpi, WIDX_RESEARCH_FUNDING);
|
||||
WindowResearchFundingPagePaint(this, dpi, WIDX_RESEARCH_FUNDING);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
|
|
@ -432,8 +432,8 @@ public:
|
|||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
ScreenCoordsXY screenCoords;
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowFootpathDrawDropdownButtons(&dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
WindowFootpathDrawDropdownButtons(dpi);
|
||||
|
||||
if (!IsWidgetDisabled(WIDX_CONSTRUCT))
|
||||
{
|
||||
|
@ -568,7 +568,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void WindowFootpathDrawDropdownButtons(DrawPixelInfo* dpi)
|
||||
void WindowFootpathDrawDropdownButtons(DrawPixelInfo& dpi)
|
||||
{
|
||||
if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL)
|
||||
{
|
||||
|
@ -620,10 +620,10 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void WindowFootpathDrawDropdownButton(DrawPixelInfo* dpi, WidgetIndex widgetIndex, ImageIndex image)
|
||||
void WindowFootpathDrawDropdownButton(DrawPixelInfo& dpi, WidgetIndex widgetIndex, ImageIndex image)
|
||||
{
|
||||
const auto& widget = widgets[widgetIndex];
|
||||
GfxDrawSprite(*dpi, ImageId(image), { windowPos.x + widget.left, windowPos.y + widget.top });
|
||||
GfxDrawSprite(dpi, ImageId(image), { windowPos.x + widget.left, windowPos.y + widget.top });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,16 +72,16 @@ uint8_t gToolbarDirtyFlags;
|
|||
static void WindowGameBottomToolbarMouseup(WindowBase *w, WidgetIndex widgetIndex);
|
||||
static OpenRCT2String WindowGameBottomToolbarTooltip(WindowBase* w, const WidgetIndex widgetIndex, const StringId fallback);
|
||||
static void WindowGameBottomToolbarInvalidate(WindowBase *w);
|
||||
static void WindowGameBottomToolbarPaint(WindowBase *w, DrawPixelInfo *dpi);
|
||||
static void WindowGameBottomToolbarPaint(WindowBase *w, DrawPixelInfo& dpi);
|
||||
static void WindowGameBottomToolbarUpdate(WindowBase* w);
|
||||
static void WindowGameBottomToolbarCursor(WindowBase *w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, CursorID *cursorId);
|
||||
static void WindowGameBottomToolbarUnknown05(WindowBase *w);
|
||||
|
||||
static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo *dpi, WindowBase *w);
|
||||
static void WindowGameBottomToolbarDrawParkRating(DrawPixelInfo *dpi, WindowBase *w, int32_t colour, const ScreenCoordsXY& coords, uint8_t factor);
|
||||
static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo *dpi, WindowBase *w);
|
||||
static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo *dpi, WindowBase *w);
|
||||
static void WindowGameBottomToolbarDrawMiddlePanel(DrawPixelInfo *dpi, WindowBase *w);
|
||||
static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo& dpi, WindowBase *w);
|
||||
static void WindowGameBottomToolbarDrawParkRating(DrawPixelInfo& dpi, WindowBase *w, int32_t colour, const ScreenCoordsXY& coords, uint8_t factor);
|
||||
static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo& dpi, WindowBase *w);
|
||||
static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo& dpi, WindowBase *w);
|
||||
static void WindowGameBottomToolbarDrawMiddlePanel(DrawPixelInfo& dpi, WindowBase *w);
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -338,7 +338,7 @@ void WindowGameBottomToolbarInvalidateNewsItem()
|
|||
*
|
||||
* rct2: 0x0066BC87
|
||||
*/
|
||||
static void WindowGameBottomToolbarPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowGameBottomToolbarPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
auto leftWidget = window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET];
|
||||
auto rightWidget = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET];
|
||||
|
@ -347,18 +347,18 @@ static void WindowGameBottomToolbarPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
// Draw panel grey backgrounds
|
||||
auto leftTop = w->windowPos + ScreenCoordsXY{ leftWidget.left, leftWidget.top };
|
||||
auto rightBottom = w->windowPos + ScreenCoordsXY{ leftWidget.right, leftWidget.bottom };
|
||||
GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
GfxFilterRect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
|
||||
leftTop = w->windowPos + ScreenCoordsXY{ rightWidget.left, rightWidget.top };
|
||||
rightBottom = w->windowPos + ScreenCoordsXY{ rightWidget.right, rightWidget.bottom };
|
||||
GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
GfxFilterRect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
|
||||
if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
|
||||
{
|
||||
// Draw grey background
|
||||
leftTop = w->windowPos + ScreenCoordsXY{ middleWidget.left, middleWidget.top };
|
||||
rightBottom = w->windowPos + ScreenCoordsXY{ middleWidget.right, middleWidget.bottom };
|
||||
GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
GfxFilterRect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
}
|
||||
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
|
@ -376,7 +376,7 @@ static void WindowGameBottomToolbarPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
}
|
||||
}
|
||||
|
||||
static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
const auto topLeft = w->windowPos
|
||||
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left + 1,
|
||||
|
@ -385,7 +385,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo* dpi, WindowBase*
|
|||
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right - 1,
|
||||
window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom - 1 };
|
||||
// Draw green inset rectangle on panel
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = FontGetLineHeight(FontStyle::Medium);
|
||||
|
@ -404,7 +404,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<money64>(gCash);
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
|
||||
}
|
||||
|
||||
static constexpr const StringId _guestCountFormats[] = {
|
||||
|
@ -432,7 +432,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo* dpi, WindowBase*
|
|||
: NOT_TRANSLUCENT(w->colours[0]));
|
||||
auto ft = Formatter();
|
||||
ft.Add<uint32_t>(gNumGuestsInPark);
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE });
|
||||
}
|
||||
|
||||
// Draw park rating
|
||||
|
@ -450,27 +450,27 @@ static void WindowGameBottomToolbarDrawLeftPanel(DrawPixelInfo* dpi, WindowBase*
|
|||
* rct2: 0x0066C76C
|
||||
*/
|
||||
static void WindowGameBottomToolbarDrawParkRating(
|
||||
DrawPixelInfo* dpi, WindowBase* w, int32_t colour, const ScreenCoordsXY& coords, uint8_t factor)
|
||||
DrawPixelInfo& dpi, WindowBase* w, int32_t colour, const ScreenCoordsXY& coords, uint8_t factor)
|
||||
{
|
||||
int16_t bar_width;
|
||||
|
||||
bar_width = (factor * 114) / 255;
|
||||
GfxFillRectInset(
|
||||
dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, w->colours[1], INSET_RECT_F_30);
|
||||
&dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, w->colours[1], INSET_RECT_F_30);
|
||||
if (!(colour & BAR_BLINK) || GameIsPaused() || (gCurrentRealTimeTicks & 8))
|
||||
{
|
||||
if (bar_width > 2)
|
||||
{
|
||||
GfxFillRectInset(dpi, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, colour, 0);
|
||||
GfxFillRectInset(&dpi, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, colour, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw thumbs on the sides
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_RATING_LOW), coords - ScreenCoordsXY{ 14, 0 });
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_RATING_HIGH), coords + ScreenCoordsXY{ 114, 0 });
|
||||
GfxDrawSprite(dpi, ImageId(SPR_RATING_LOW), coords - ScreenCoordsXY{ 14, 0 });
|
||||
GfxDrawSprite(dpi, ImageId(SPR_RATING_HIGH), coords + ScreenCoordsXY{ 114, 0 });
|
||||
}
|
||||
|
||||
static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
const auto topLeft = w->windowPos
|
||||
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 1,
|
||||
|
@ -479,7 +479,7 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase
|
|||
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right - 1,
|
||||
window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom - 1 };
|
||||
// Draw green inset rectangle on panel
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
auto screenCoords = ScreenCoordsXY{ (window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left
|
||||
+ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right)
|
||||
|
@ -502,7 +502,7 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase
|
|||
ft.Add<StringId>(DateDayNames[day]);
|
||||
ft.Add<int16_t>(month);
|
||||
ft.Add<int16_t>(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);
|
||||
|
@ -520,12 +520,12 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase
|
|||
}
|
||||
ft = Formatter();
|
||||
ft.Add<int16_t>(temperature);
|
||||
DrawTextBasic(*dpi, screenCoords + ScreenCoordsXY{ 0, 6 }, format, ft);
|
||||
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 0, 6 }, format, ft);
|
||||
screenCoords.x += 30;
|
||||
|
||||
// Current weather
|
||||
auto currentWeatherSpriteId = ClimateGetWeatherSpriteId(gClimateCurrent);
|
||||
GfxDrawSprite(*dpi, ImageId(currentWeatherSpriteId), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(currentWeatherSpriteId), screenCoords);
|
||||
|
||||
// Next weather
|
||||
auto nextWeatherSpriteId = ClimateGetWeatherSpriteId(gClimateNext);
|
||||
|
@ -533,8 +533,8 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase
|
|||
{
|
||||
if (gClimateUpdateTimer < 960)
|
||||
{
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_NEXT_WEATHER), screenCoords + ScreenCoordsXY{ 27, 5 });
|
||||
GfxDrawSprite(*dpi, ImageId(nextWeatherSpriteId), screenCoords + ScreenCoordsXY{ 40, 0 });
|
||||
GfxDrawSprite(dpi, ImageId(SPR_NEXT_WEATHER), screenCoords + ScreenCoordsXY{ 27, 5 });
|
||||
GfxDrawSprite(dpi, ImageId(nextWeatherSpriteId), screenCoords + ScreenCoordsXY{ 40, 0 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ static void WindowGameBottomToolbarDrawRightPanel(DrawPixelInfo* dpi, WindowBase
|
|||
*
|
||||
* rct2: 0x0066BFA5
|
||||
*/
|
||||
static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
int32_t width;
|
||||
News::Item* newsItem;
|
||||
|
@ -554,7 +554,7 @@ static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo* dpi, WindowBase*
|
|||
|
||||
// Current news item
|
||||
GfxFillRectInset(
|
||||
dpi,
|
||||
&dpi,
|
||||
{ w->windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 },
|
||||
w->windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } },
|
||||
w->colours[2], INSET_RECT_F_30);
|
||||
|
@ -563,7 +563,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,
|
||||
|
@ -571,7 +571,7 @@ static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo* dpi, WindowBase*
|
|||
switch (newsItem->Type)
|
||||
{
|
||||
case News::ItemType::Ride:
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_RIDE), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(SPR_RIDE), screenCoords);
|
||||
break;
|
||||
case News::ItemType::PeepOnRide:
|
||||
case News::ItemType::Peep:
|
||||
|
@ -580,7 +580,7 @@ static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo* dpi, WindowBase*
|
|||
break;
|
||||
|
||||
DrawPixelInfo cliped_dpi;
|
||||
if (!ClipDrawPixelInfo(&cliped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22))
|
||||
if (!ClipDrawPixelInfo(&cliped_dpi, &dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -623,19 +623,19 @@ static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo* dpi, WindowBase*
|
|||
}
|
||||
case News::ItemType::Money:
|
||||
case News::ItemType::Campaign:
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_FINANCE), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenCoords);
|
||||
break;
|
||||
case News::ItemType::Research:
|
||||
GfxDrawSprite(*dpi, ImageId(newsItem->Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(newsItem->Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords);
|
||||
break;
|
||||
case News::ItemType::Peeps:
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_GUESTS), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(SPR_GUESTS), screenCoords);
|
||||
break;
|
||||
case News::ItemType::Award:
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_AWARD), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(SPR_AWARD), screenCoords);
|
||||
break;
|
||||
case News::ItemType::Graph:
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_GRAPH), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(SPR_GRAPH), screenCoords);
|
||||
break;
|
||||
case News::ItemType::Null:
|
||||
case News::ItemType::Blank:
|
||||
|
@ -644,12 +644,12 @@ static void WindowGameBottomToolbarDrawNewsItem(DrawPixelInfo* dpi, WindowBase*
|
|||
}
|
||||
}
|
||||
|
||||
static void WindowGameBottomToolbarDrawMiddlePanel(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowGameBottomToolbarDrawMiddlePanel(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
Widget* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET];
|
||||
|
||||
GfxFillRectInset(
|
||||
dpi,
|
||||
&dpi,
|
||||
{ w->windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 },
|
||||
w->windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } },
|
||||
w->colours[1], INSET_RECT_F_30);
|
||||
|
@ -668,12 +668,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 });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -752,7 +752,7 @@ private:
|
|||
// Draw the viewport no sound sprite
|
||||
if (viewport != nullptr)
|
||||
{
|
||||
WindowDrawViewport(&dpi, *this);
|
||||
WindowDrawViewport(dpi, *this);
|
||||
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
|
||||
{
|
||||
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
|
||||
|
|
|
@ -1112,7 +1112,7 @@ static Widget window_overwrite_prompt_widgets[] = {
|
|||
};
|
||||
|
||||
static void WindowOverwritePromptMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
|
||||
static WindowEventList window_overwrite_prompt_events([](auto& events) {
|
||||
events.mouse_up = &WindowOverwritePromptMouseup;
|
||||
|
@ -1164,7 +1164,7 @@ static void WindowOverwritePromptMouseup(WindowBase* w, WidgetIndex widgetIndex)
|
|||
}
|
||||
}
|
||||
|
||||
static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
|
||||
|
@ -1173,7 +1173,7 @@ static void WindowOverwritePromptPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
ft.Add<char*>(_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
|
||||
|
|
|
@ -719,13 +719,13 @@ public:
|
|||
|
||||
if (selected_tab == PAGE_PEEPS)
|
||||
{
|
||||
PaintPeepOverlay(&dpi);
|
||||
PaintPeepOverlay(dpi);
|
||||
}
|
||||
else
|
||||
{
|
||||
PaintTrainOverlay(&dpi);
|
||||
PaintTrainOverlay(dpi);
|
||||
}
|
||||
PaintHudRectangle(&dpi);
|
||||
PaintHudRectangle(dpi);
|
||||
}
|
||||
|
||||
void OnPrepareDraw() override
|
||||
|
@ -855,7 +855,7 @@ public:
|
|||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
DrawWidgets(dpi);
|
||||
DrawTabImages(&dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
auto screenCoords = windowPos
|
||||
+ ScreenCoordsXY{ window_map_widgets[WIDX_LAND_TOOL].midX(), window_map_widgets[WIDX_LAND_TOOL].midY() };
|
||||
|
@ -1161,7 +1161,7 @@ private:
|
|||
return colourB;
|
||||
}
|
||||
|
||||
void PaintPeepOverlay(DrawPixelInfo* dpi)
|
||||
void PaintPeepOverlay(DrawPixelInfo& dpi)
|
||||
{
|
||||
auto flashColour = GetGuestFlashColour();
|
||||
for (auto guest : EntityList<Guest>())
|
||||
|
@ -1175,7 +1175,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void DrawMapPeepPixel(Peep* peep, const uint8_t flashColour, DrawPixelInfo* dpi)
|
||||
void DrawMapPeepPixel(Peep* peep, const uint8_t flashColour, DrawPixelInfo& dpi)
|
||||
{
|
||||
if (peep->x == LOCATION_NULL)
|
||||
return;
|
||||
|
@ -1194,7 +1194,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
GfxFillRect(dpi, { leftTop, rightBottom }, colour);
|
||||
GfxFillRect(&dpi, { leftTop, rightBottom }, colour);
|
||||
}
|
||||
|
||||
static uint8_t GetGuestFlashColour()
|
||||
|
@ -1221,7 +1221,7 @@ private:
|
|||
return colour;
|
||||
}
|
||||
|
||||
void PaintTrainOverlay(DrawPixelInfo* dpi)
|
||||
void PaintTrainOverlay(DrawPixelInfo& dpi)
|
||||
{
|
||||
for (auto train : TrainManager::View())
|
||||
{
|
||||
|
@ -1232,7 +1232,7 @@ private:
|
|||
|
||||
MapCoordsXY c = TransformToMapCoords({ vehicle->x, vehicle->y });
|
||||
|
||||
GfxFillRect(dpi, { { c.x, c.y }, { c.x, c.y } }, PALETTE_INDEX_171);
|
||||
GfxFillRect(&dpi, { { c.x, c.y }, { c.x, c.y } }, PALETTE_INDEX_171);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1241,7 +1241,7 @@ private:
|
|||
* The call to GfxFillRect was originally wrapped in Sub68DABD which made sure that arguments were ordered correctly,
|
||||
* but it doesn't look like it's ever necessary here so the call was removed.
|
||||
*/
|
||||
void PaintHudRectangle(DrawPixelInfo* dpi)
|
||||
void PaintHudRectangle(DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowBase* mainWindow = WindowGetMain();
|
||||
if (mainWindow == nullptr)
|
||||
|
@ -1259,23 +1259,23 @@ private:
|
|||
auto leftBottom = ScreenCoordsXY{ leftTop.x, rightBottom.y };
|
||||
|
||||
// top horizontal lines
|
||||
GfxFillRect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(dpi, { rightTop - ScreenCoordsXY{ 3, 0 }, rightTop }, PALETTE_INDEX_56);
|
||||
GfxFillRect(&dpi, { leftTop, leftTop + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(&dpi, { rightTop - ScreenCoordsXY{ 3, 0 }, rightTop }, PALETTE_INDEX_56);
|
||||
|
||||
// left vertical lines
|
||||
GfxFillRect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(dpi, { leftBottom - ScreenCoordsXY{ 0, 3 }, leftBottom }, PALETTE_INDEX_56);
|
||||
GfxFillRect(&dpi, { leftTop, leftTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(&dpi, { leftBottom - ScreenCoordsXY{ 0, 3 }, leftBottom }, PALETTE_INDEX_56);
|
||||
|
||||
// bottom horizontal lines
|
||||
GfxFillRect(dpi, { leftBottom, leftBottom + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(dpi, { rightBottom - ScreenCoordsXY{ 3, 0 }, rightBottom }, PALETTE_INDEX_56);
|
||||
GfxFillRect(&dpi, { leftBottom, leftBottom + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(&dpi, { rightBottom - ScreenCoordsXY{ 3, 0 }, rightBottom }, PALETTE_INDEX_56);
|
||||
|
||||
// right vertical lines
|
||||
GfxFillRect(dpi, { rightTop, rightTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(dpi, { rightBottom - ScreenCoordsXY{ 0, 3 }, rightBottom }, PALETTE_INDEX_56);
|
||||
GfxFillRect(&dpi, { rightTop, rightTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(&dpi, { rightBottom - ScreenCoordsXY{ 0, 3 }, rightBottom }, PALETTE_INDEX_56);
|
||||
}
|
||||
|
||||
void DrawTabImages(DrawPixelInfo* dpi)
|
||||
void DrawTabImages(DrawPixelInfo& dpi)
|
||||
{
|
||||
// Guest tab image (animated)
|
||||
uint32_t guestTabImage = SPR_TAB_GUESTS_0;
|
||||
|
@ -1283,7 +1283,7 @@ private:
|
|||
guestTabImage += list_information_type / 4;
|
||||
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(guestTabImage),
|
||||
dpi, ImageId(guestTabImage),
|
||||
windowPos + ScreenCoordsXY{ widgets[WIDX_PEOPLE_TAB].left, widgets[WIDX_PEOPLE_TAB].top });
|
||||
|
||||
// Ride/stall tab image (animated)
|
||||
|
@ -1292,7 +1292,7 @@ private:
|
|||
rideTabImage += list_information_type / 4;
|
||||
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(rideTabImage),
|
||||
dpi, ImageId(rideTabImage),
|
||||
windowPos + ScreenCoordsXY{ widgets[WIDX_RIDES_TAB].left, widgets[WIDX_RIDES_TAB].top });
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ static Widget window_map_tooltip_widgets[] = {
|
|||
};
|
||||
|
||||
static void WindowMapTooltipUpdate(WindowBase *w);
|
||||
static void WindowMapTooltipPaint(WindowBase *w, DrawPixelInfo *dpi);
|
||||
static void WindowMapTooltipPaint(WindowBase *w, DrawPixelInfo& dpi);
|
||||
|
||||
static WindowEventList window_map_tooltip_events([](auto& events)
|
||||
{
|
||||
|
@ -137,7 +137,7 @@ static void WindowMapTooltipUpdate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006EE894
|
||||
*/
|
||||
static void WindowMapTooltipPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowMapTooltipPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
StringId stringId;
|
||||
std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId));
|
||||
|
@ -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 });
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ static void WindowMultiplayerInformationMouseup(WindowBase *w, WidgetIndex widge
|
|||
static void WindowMultiplayerInformationResize(WindowBase *w);
|
||||
static void WindowMultiplayerInformationUpdate(WindowBase *w);
|
||||
static void WindowMultiplayerInformationInvalidate(WindowBase *w);
|
||||
static void WindowMultiplayerInformationPaint(WindowBase *w, DrawPixelInfo *dpi);
|
||||
static void WindowMultiplayerInformationPaint(WindowBase *w, DrawPixelInfo& dpi);
|
||||
|
||||
static void WindowMultiplayerPlayersMouseup(WindowBase *w, WidgetIndex widgetIndex);
|
||||
static void WindowMultiplayerPlayersResize(WindowBase *w);
|
||||
|
@ -133,8 +133,8 @@ static void WindowMultiplayerPlayersScrollgetsize(WindowBase *w, int32_t scrollI
|
|||
static void WindowMultiplayerPlayersScrollmousedown(WindowBase *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void WindowMultiplayerPlayersScrollmouseover(WindowBase *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void WindowMultiplayerPlayersInvalidate(WindowBase *w);
|
||||
static void WindowMultiplayerPlayersPaint(WindowBase *w, DrawPixelInfo *dpi);
|
||||
static void WindowMultiplayerPlayersScrollpaint(WindowBase *w, DrawPixelInfo *dpi, int32_t scrollIndex);
|
||||
static void WindowMultiplayerPlayersPaint(WindowBase *w, DrawPixelInfo& dpi);
|
||||
static void WindowMultiplayerPlayersScrollpaint(WindowBase *w, DrawPixelInfo& dpi, int32_t scrollIndex);
|
||||
|
||||
static void WindowMultiplayerGroupsMouseup(WindowBase *w, WidgetIndex widgetIndex);
|
||||
static void WindowMultiplayerGroupsResize(WindowBase *w);
|
||||
|
@ -146,14 +146,14 @@ static void WindowMultiplayerGroupsScrollmousedown(WindowBase *w, int32_t scroll
|
|||
static void WindowMultiplayerGroupsScrollmouseover(WindowBase *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void WindowMultiplayerGroupsTextInput(WindowBase *w, WidgetIndex widgetIndex, const char *text);
|
||||
static void WindowMultiplayerGroupsInvalidate(WindowBase *w);
|
||||
static void WindowMultiplayerGroupsPaint(WindowBase *w, DrawPixelInfo *dpi);
|
||||
static void WindowMultiplayerGroupsScrollpaint(WindowBase *w, DrawPixelInfo *dpi, int32_t scrollIndex);
|
||||
static void WindowMultiplayerGroupsPaint(WindowBase *w, DrawPixelInfo& dpi);
|
||||
static void WindowMultiplayerGroupsScrollpaint(WindowBase *w, DrawPixelInfo& dpi, int32_t scrollIndex);
|
||||
|
||||
static void WindowMultiplayerOptionsMouseup(WindowBase *w, WidgetIndex widgetIndex);
|
||||
static void WindowMultiplayerOptionsResize(WindowBase *w);
|
||||
static void WindowMultiplayerOptionsUpdate(WindowBase *w);
|
||||
static void WindowMultiplayerOptionsInvalidate(WindowBase *w);
|
||||
static void WindowMultiplayerOptionsPaint(WindowBase *w, DrawPixelInfo *dpi);
|
||||
static void WindowMultiplayerOptionsPaint(WindowBase *w, DrawPixelInfo& dpi);
|
||||
|
||||
static WindowEventList window_multiplayer_information_events([](auto& events)
|
||||
{
|
||||
|
@ -223,7 +223,7 @@ static constexpr const int32_t window_multiplayer_animation_frames[] = {
|
|||
4,
|
||||
};
|
||||
|
||||
static void WindowMultiplayerDrawTabImages(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowMultiplayerDrawTabImages(WindowBase* w, DrawPixelInfo& dpi);
|
||||
static void WindowMultiplayerSetPage(WindowBase* w, int32_t page);
|
||||
|
||||
static bool _windowInformationSizeDirty;
|
||||
|
@ -395,16 +395,14 @@ static void WindowMultiplayerInformationInvalidate(WindowBase* w)
|
|||
WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4);
|
||||
}
|
||||
|
||||
static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowMultiplayerDrawTabImages(w, dpi);
|
||||
|
||||
DrawPixelInfo clippedDPI;
|
||||
if (ClipDrawPixelInfo(&clippedDPI, dpi, w->windowPos, w->width, w->height))
|
||||
if (ClipDrawPixelInfo(&clippedDPI, &dpi, w->windowPos, w->width, w->height))
|
||||
{
|
||||
dpi = &clippedDPI;
|
||||
|
||||
auto screenCoords = ScreenCoordsXY{ 3, 50 };
|
||||
int32_t width = w->width - 6;
|
||||
|
||||
|
@ -412,7 +410,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<const char*>(name.c_str());
|
||||
screenCoords.y += DrawTextWrapped(*dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] });
|
||||
screenCoords.y += DrawTextWrapped(clippedDPI, screenCoords, width, STR_STRING, ft, { w->colours[1] });
|
||||
screenCoords.y += LIST_ROW_HEIGHT / 2;
|
||||
}
|
||||
|
||||
|
@ -421,7 +419,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<const char*>(description.c_str());
|
||||
screenCoords.y += DrawTextWrapped(*dpi, screenCoords, width, STR_STRING, ft, { w->colours[1] });
|
||||
screenCoords.y += DrawTextWrapped(clippedDPI, screenCoords, width, STR_STRING, ft, { w->colours[1] });
|
||||
screenCoords.y += LIST_ROW_HEIGHT / 2;
|
||||
}
|
||||
|
||||
|
@ -430,7 +428,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<const char*>(providerName.c_str());
|
||||
DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_NAME, ft);
|
||||
DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_NAME, ft);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
@ -439,7 +437,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<const char*>(providerEmail.c_str());
|
||||
DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_EMAIL, ft);
|
||||
DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_EMAIL, ft);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
@ -448,7 +446,7 @@ static void WindowMultiplayerInformationPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<const char*>(providerWebsite.c_str());
|
||||
DrawTextBasic(*dpi, screenCoords, STR_PROVIDER_WEBSITE, ft);
|
||||
DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_WEBSITE, ft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -557,7 +555,7 @@ static void WindowMultiplayerPlayersInvalidate(WindowBase* w)
|
|||
WindowAlignTabs(w, WIDX_TAB1, WIDX_TAB4);
|
||||
}
|
||||
|
||||
static void WindowMultiplayerPlayersPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowMultiplayerPlayersPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
StringId stringId;
|
||||
|
||||
|
@ -569,10 +567,10 @@ static void WindowMultiplayerPlayersPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
auto screenCoords = w->windowPos + ScreenCoordsXY{ 4, w->widgets[WIDX_LIST].bottom + 2 };
|
||||
auto ft = Formatter();
|
||||
ft.Add<uint16_t>(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)
|
||||
static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex)
|
||||
{
|
||||
ScreenCoordsXY screenCoords;
|
||||
screenCoords.y = 0;
|
||||
|
@ -582,12 +580,12 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp
|
|||
|
||||
for (int32_t player = firstPlayerInList; player < NetworkGetNumPlayers(); player++)
|
||||
{
|
||||
if (screenCoords.y > dpi->y + dpi->height)
|
||||
if (screenCoords.y > dpi.y + dpi.height)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi->y)
|
||||
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi.y)
|
||||
{
|
||||
thread_local std::string _buffer;
|
||||
_buffer.reserve(512);
|
||||
|
@ -598,7 +596,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp
|
|||
if (listPosition == w->selected_list_item)
|
||||
{
|
||||
GfxFilterRect(
|
||||
dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 },
|
||||
&dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 },
|
||||
FilterPaletteID::PaletteDarken1);
|
||||
_buffer += NetworkGetPlayerName(player);
|
||||
colour = w->colours[2];
|
||||
|
@ -617,7 +615,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 +626,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 +640,7 @@ static void WindowMultiplayerPlayersScrollpaint(WindowBase* w, DrawPixelInfo* dp
|
|||
{
|
||||
ft.Add<StringId>(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 +663,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++;
|
||||
|
@ -841,7 +839,7 @@ static void WindowMultiplayerGroupsInvalidate(WindowBase* w)
|
|||
}
|
||||
}
|
||||
|
||||
static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
thread_local std::string _buffer;
|
||||
|
||||
|
@ -858,7 +856,7 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
auto ft = Formatter();
|
||||
ft.Add<const char*>(_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,12 +864,12 @@ 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;
|
||||
|
||||
GfxFillRectInset(
|
||||
dpi, { screenPos - ScreenCoordsXY{ 0, 6 }, screenPos + ScreenCoordsXY{ 310, -5 } }, w->colours[1],
|
||||
&dpi, { screenPos - ScreenCoordsXY{ 0, 6 }, screenPos + ScreenCoordsXY{ 310, -5 } }, w->colours[1],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
widget = &window_multiplayer_groups_widgets[WIDX_SELECTED_GROUP];
|
||||
|
@ -883,32 +881,32 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
auto ft = Formatter();
|
||||
ft.Add<const char*>(_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 });
|
||||
}
|
||||
}
|
||||
|
||||
static void WindowMultiplayerGroupsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex)
|
||||
static void WindowMultiplayerGroupsScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex)
|
||||
{
|
||||
auto screenCoords = ScreenCoordsXY{ 0, 0 };
|
||||
|
||||
auto dpiCoords = ScreenCoordsXY{ dpi->x, dpi->y };
|
||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||
GfxFillRect(
|
||||
dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi->width - 1, dpi->height - 1 } }, ColourMapA[w->colours[1]].mid_light);
|
||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[w->colours[1]].mid_light);
|
||||
|
||||
for (int32_t i = 0; i < NetworkGetNumActions(); i++)
|
||||
{
|
||||
if (i == w->selected_list_item)
|
||||
{
|
||||
GfxFilterRect(
|
||||
dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||
&dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||
}
|
||||
if (screenCoords.y > dpi->y + dpi->height)
|
||||
if (screenCoords.y > dpi.y + dpi.height)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi->y)
|
||||
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi.y)
|
||||
{
|
||||
int32_t groupindex = NetworkGetGroupIndex(_selectedGroup);
|
||||
if (groupindex != -1)
|
||||
|
@ -916,14 +914,14 @@ static void WindowMultiplayerGroupsScrollpaint(WindowBase* w, DrawPixelInfo* dpi
|
|||
if (NetworkCanPerformAction(groupindex, static_cast<NetworkPermission>(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<uint16_t>(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;
|
||||
}
|
||||
|
@ -991,7 +989,7 @@ static void WindowMultiplayerOptionsInvalidate(WindowBase* w)
|
|||
WidgetSetCheckboxValue(*w, WIDX_KNOWN_KEYS_ONLY_CHECKBOX, gConfigNetwork.KnownKeysOnly);
|
||||
}
|
||||
|
||||
static void WindowMultiplayerOptionsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowMultiplayerOptionsPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowMultiplayerDrawTabImages(w, dpi);
|
||||
|
@ -999,7 +997,7 @@ static void WindowMultiplayerOptionsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
|
||||
#pragma endregion
|
||||
|
||||
static void WindowMultiplayerDrawTabImage(WindowBase* w, DrawPixelInfo* dpi, int32_t page, int32_t spriteIndex)
|
||||
static void WindowMultiplayerDrawTabImage(WindowBase* w, DrawPixelInfo& dpi, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_TAB1 + page;
|
||||
|
||||
|
@ -1016,12 +1014,12 @@ static void WindowMultiplayerDrawTabImage(WindowBase* w, DrawPixelInfo* dpi, int
|
|||
}
|
||||
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(spriteIndex),
|
||||
dpi, ImageId(spriteIndex),
|
||||
w->windowPos + ScreenCoordsXY{ w->widgets[widgetIndex].left, w->widgets[widgetIndex].top });
|
||||
}
|
||||
}
|
||||
|
||||
static void WindowMultiplayerDrawTabImages(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowMultiplayerDrawTabImages(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowMultiplayerDrawTabImage(w, dpi, WINDOW_MULTIPLAYER_PAGE_INFORMATION, SPR_TAB_KIOSKS_AND_FACILITIES_0);
|
||||
WindowMultiplayerDrawTabImage(w, dpi, WINDOW_MULTIPLAYER_PAGE_PLAYERS, SPR_TAB_GUESTS_0);
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
thread_local std::string _buffer;
|
||||
_buffer.assign("{BLACK}");
|
||||
_buffer += _windowNetworkStatusText;
|
||||
|
|
|
@ -427,7 +427,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
WindowResearchDevelopmentPagePaint(this, &dpi, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP);
|
||||
WindowResearchDevelopmentPagePaint(this, dpi, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ public:
|
|||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
DrawWidgets(dpi);
|
||||
DrawTabImages(&dpi);
|
||||
DrawTabImages(dpi);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -218,14 +218,14 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void DrawTabImages(DrawPixelInfo* dpi)
|
||||
void DrawTabImages(DrawPixelInfo& dpi)
|
||||
{
|
||||
DrawTabImage(dpi, NOTIFICATION_CATEGORY_PARK, SPR_TAB_PARK);
|
||||
DrawTabImage(dpi, NOTIFICATION_CATEGORY_RIDE, SPR_TAB_RIDE_0);
|
||||
DrawTabImage(dpi, NOTIFICATION_CATEGORY_GUEST, SPR_TAB_GUESTS_0);
|
||||
}
|
||||
|
||||
void DrawTabImage(DrawPixelInfo* dpi, int32_t p, int32_t spriteIndex)
|
||||
void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t spriteIndex)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_FIRST_TAB + p;
|
||||
|
||||
|
@ -242,7 +242,7 @@ private:
|
|||
}
|
||||
|
||||
const auto& widget = widgets[widgetIndex];
|
||||
GfxDrawSprite(*dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top });
|
||||
GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -487,7 +487,7 @@ public:
|
|||
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
|
||||
// Draw explanatory message
|
||||
auto ft = Formatter();
|
||||
|
|
|
@ -555,15 +555,15 @@ public:
|
|||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
DrawWidgets(dpi);
|
||||
DrawTabImages(&dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
switch (page)
|
||||
{
|
||||
case WINDOW_OPTIONS_PAGE_DISPLAY:
|
||||
DisplayDraw(&dpi);
|
||||
DisplayDraw(dpi);
|
||||
break;
|
||||
case WINDOW_OPTIONS_PAGE_ADVANCED:
|
||||
AdvancedDraw(&dpi);
|
||||
AdvancedDraw(dpi);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -909,12 +909,12 @@ private:
|
|||
widgets[WIDX_DRAWING_ENGINE].text = DrawingEngineStringIds[EnumValue(gConfigGeneral.DrawingEngine)];
|
||||
}
|
||||
|
||||
void DisplayDraw(DrawPixelInfo* dpi)
|
||||
void DisplayDraw(DrawPixelInfo& dpi)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<int32_t>(static_cast<int32_t>(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
|
||||
|
@ -1997,12 +1997,12 @@ private:
|
|||
widgets[WIDX_AUTOSAVE_FREQUENCY].text = AutosaveNames[gConfigGeneral.AutosaveFrequency];
|
||||
}
|
||||
|
||||
void AdvancedDraw(DrawPixelInfo* dpi)
|
||||
void AdvancedDraw(DrawPixelInfo& dpi)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<int32_t>(static_cast<int32_t>(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<int32_t>(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)
|
||||
|
@ -2068,7 +2068,7 @@ private:
|
|||
Dropdown::Flag::StayOpen, num_items, widget->width() - 3);
|
||||
}
|
||||
|
||||
void DrawTabImages(DrawPixelInfo* dpi)
|
||||
void DrawTabImages(DrawPixelInfo& dpi)
|
||||
{
|
||||
DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_DISPLAY, SPR_TAB_PAINT_0);
|
||||
DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_RENDERING, SPR_G2_TAB_TREE);
|
||||
|
@ -2079,7 +2079,7 @@ private:
|
|||
DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_ADVANCED, SPR_TAB_WRENCH_0);
|
||||
}
|
||||
|
||||
void DrawTabImage(DrawPixelInfo* dpi, int32_t p, int32_t spriteIndex)
|
||||
void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t spriteIndex)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_FIRST_TAB + p;
|
||||
Widget* widget = &widgets[widgetIndex];
|
||||
|
@ -2095,7 +2095,7 @@ private:
|
|||
}
|
||||
|
||||
// Draw normal, enabled sprite.
|
||||
GfxDrawSprite(*dpi, ImageId(spriteIndex), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(spriteIndex), screenCoords);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2104,10 +2104,10 @@ private:
|
|||
|
||||
// Draw greyed out (light border bottom right shadow)
|
||||
GfxDrawSpriteSolid(
|
||||
dpi, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter);
|
||||
&dpi, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter);
|
||||
|
||||
// Draw greyed out (dark)
|
||||
GfxDrawSpriteSolid(dpi, ImageId(spriteIndex), screenCoords, ColourMapA[window_colour].mid_light);
|
||||
GfxDrawSpriteSolid(&dpi, ImageId(spriteIndex), screenCoords, ColourMapA[window_colour].mid_light);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -593,7 +593,7 @@ private:
|
|||
// Draw viewport
|
||||
if (viewport != nullptr)
|
||||
{
|
||||
WindowDrawViewport(&dpi, *this);
|
||||
WindowDrawViewport(dpi, *this);
|
||||
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
|
||||
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
|
||||
}
|
||||
|
|
|
@ -165,11 +165,11 @@ public:
|
|||
switch (page)
|
||||
{
|
||||
case WINDOW_PLAYER_PAGE_OVERVIEW:
|
||||
OnDrawOverview(&dpi);
|
||||
OnDrawOverview(dpi);
|
||||
break;
|
||||
|
||||
case WINDOW_PLAYER_PAGE_STATISTICS:
|
||||
OnDrawStatistics(&dpi);
|
||||
OnDrawStatistics(dpi);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void DrawTabImages(DrawPixelInfo* dpi)
|
||||
void DrawTabImages(DrawPixelInfo& dpi)
|
||||
{
|
||||
Widget* widget;
|
||||
|
||||
|
@ -267,7 +267,7 @@ private:
|
|||
{
|
||||
widget = &this->widgets[WIDX_TAB_1];
|
||||
auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top };
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_PEEP_LARGE_FACE_NORMAL), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(SPR_PEEP_LARGE_FACE_NORMAL), screenCoords);
|
||||
}
|
||||
|
||||
// Tab 2
|
||||
|
@ -282,7 +282,7 @@ private:
|
|||
imageId += (frame_no / 2) & 7;
|
||||
}
|
||||
|
||||
GfxDrawSprite(*dpi, ImageId(imageId), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(imageId), screenCoords);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -430,9 +430,9 @@ private:
|
|||
WidgetSetEnabled(*this, WIDX_KICK, canKick && !isOwnWindow && !isServer);
|
||||
}
|
||||
|
||||
void OnDrawOverview(DrawPixelInfo* dpi)
|
||||
void OnDrawOverview(DrawPixelInfo& dpi)
|
||||
{
|
||||
DrawWidgets(*dpi);
|
||||
DrawWidgets(dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
int32_t player = NetworkGetPlayerIndex(static_cast<uint8_t>(number));
|
||||
|
@ -454,7 +454,7 @@ private:
|
|||
ft.Add<const char*>(_buffer.c_str());
|
||||
|
||||
DrawTextEllipsised(
|
||||
*dpi, windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
|
||||
dpi, windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft,
|
||||
{ TextAlignment::CENTRE });
|
||||
}
|
||||
|
||||
|
@ -463,10 +463,10 @@ private:
|
|||
|
||||
auto ft = Formatter();
|
||||
ft.Add<StringId>(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, { colours[2] });
|
||||
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { colours[2] });
|
||||
|
||||
// Draw last action
|
||||
screenCoords = windowPos + ScreenCoordsXY{ width / 2, height - 13 };
|
||||
|
@ -481,7 +481,7 @@ private:
|
|||
{
|
||||
ft.Add<StringId>(STR_ACTION_NA);
|
||||
}
|
||||
DrawTextEllipsised(*dpi, screenCoords, updatedWidth, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE });
|
||||
DrawTextEllipsised(dpi, screenCoords, updatedWidth, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE });
|
||||
|
||||
if (viewport != nullptr && var_492 != -1)
|
||||
{
|
||||
|
@ -629,9 +629,9 @@ private:
|
|||
WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_2);
|
||||
}
|
||||
|
||||
void OnDrawStatistics(DrawPixelInfo* dpi)
|
||||
void OnDrawStatistics(DrawPixelInfo& dpi)
|
||||
{
|
||||
DrawWidgets(*dpi);
|
||||
DrawWidgets(dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
int32_t player = NetworkGetPlayerIndex(static_cast<uint8_t>(number));
|
||||
|
@ -646,13 +646,13 @@ private:
|
|||
|
||||
auto ft = Formatter();
|
||||
ft.Add<uint32_t>(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<uint32_t>(NetworkGetPlayerMoneySpent(player));
|
||||
DrawTextBasic(*dpi, screenCoords, STR_MONEY_SPENT, ft);
|
||||
DrawTextBasic(dpi, screenCoords, STR_MONEY_SPENT, ft);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
|
||||
auto currentRide = GetRide(rideId);
|
||||
if (currentRide != nullptr)
|
||||
|
|
|
@ -104,14 +104,14 @@ static Widget *window_research_page_widgets[] = {
|
|||
static void WindowResearchDevelopmentMouseup(WindowBase *w, WidgetIndex widgetIndex);
|
||||
static void WindowResearchDevelopmentUpdate(WindowBase *w);
|
||||
static void WindowResearchDevelopmentInvalidate(WindowBase *w);
|
||||
static void WindowResearchDevelopmentPaint(WindowBase *w, DrawPixelInfo *dpi);
|
||||
static void WindowResearchDevelopmentPaint(WindowBase *w, DrawPixelInfo& dpi);
|
||||
|
||||
static void WindowResearchFundingMouseup(WindowBase *w, WidgetIndex widgetIndex);
|
||||
static void WindowResearchFundingMousedown(WindowBase *w, WidgetIndex widgetIndex, Widget* widget);
|
||||
static void WindowResearchFundingDropdown(WindowBase *w, WidgetIndex widgetIndex, int32_t dropdownIndex);
|
||||
static void WindowResearchFundingUpdate(WindowBase *w);
|
||||
static void WindowResearchFundingInvalidate(WindowBase *w);
|
||||
static void WindowResearchFundingPaint(WindowBase *w, DrawPixelInfo *dpi);
|
||||
static void WindowResearchFundingPaint(WindowBase *w, DrawPixelInfo& dpi);
|
||||
|
||||
//
|
||||
static WindowEventList window_research_development_events([](auto& events)
|
||||
|
@ -156,7 +156,7 @@ static constexpr const StringId ResearchStageNames[] = {
|
|||
|
||||
static void WindowResearchSetPage(WindowBase* w, int32_t page);
|
||||
static void WindowResearchSetPressedTab(WindowBase* w);
|
||||
static void WindowResearchDrawTabImages(DrawPixelInfo* dpi, WindowBase* w);
|
||||
static void WindowResearchDrawTabImages(DrawPixelInfo& dpi, WindowBase* w);
|
||||
|
||||
WindowBase* WindowResearchOpen()
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ static void WindowResearchDevelopmentInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006B689B
|
||||
*/
|
||||
static void WindowResearchDevelopmentPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowResearchDevelopmentPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowResearchDrawTabImages(dpi, w);
|
||||
|
@ -261,7 +261,7 @@ static void WindowResearchDevelopmentPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
WindowResearchDevelopmentPagePaint(w, dpi, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP);
|
||||
}
|
||||
|
||||
void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, WidgetIndex baseWidgetIndex)
|
||||
void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex)
|
||||
{
|
||||
baseWidgetIndex = baseWidgetIndex - WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP;
|
||||
|
||||
|
@ -273,19 +273,19 @@ void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, Widge
|
|||
// Research type
|
||||
auto ft = Formatter();
|
||||
ft.Add<StringId>(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<StringId>(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<StringId>(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<StringId>(gResearchNextItem->GetName());
|
||||
}
|
||||
DrawTextWrapped(*dpi, screenCoords, 296, label, ft);
|
||||
DrawTextWrapped(dpi, screenCoords, 296, label, ft);
|
||||
screenCoords.y += 25;
|
||||
|
||||
// Progress
|
||||
ft = Formatter();
|
||||
ft.Add<StringId>(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<StringId>(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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -528,7 +528,7 @@ static void WindowResearchFundingInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x0069DAF0
|
||||
*/
|
||||
static void WindowResearchFundingPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowResearchFundingPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowResearchDrawTabImages(dpi, w);
|
||||
|
@ -536,7 +536,7 @@ static void WindowResearchFundingPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
WindowResearchFundingPagePaint(w, dpi, WIDX_RESEARCH_FUNDING);
|
||||
}
|
||||
|
||||
void WindowResearchFundingPagePaint(WindowBase* w, DrawPixelInfo* dpi, WidgetIndex baseWidgetIndex)
|
||||
void WindowResearchFundingPagePaint(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex)
|
||||
{
|
||||
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
||||
return;
|
||||
|
@ -544,7 +544,7 @@ void WindowResearchFundingPagePaint(WindowBase* w, DrawPixelInfo* dpi, WidgetInd
|
|||
int32_t currentResearchLevel = gResearchFundingLevel;
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(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
|
||||
|
@ -593,7 +593,7 @@ static void WindowResearchSetPressedTab(WindowBase* w)
|
|||
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page);
|
||||
}
|
||||
|
||||
static void WindowResearchDrawTabImage(DrawPixelInfo* dpi, WindowBase* w, int32_t page, int32_t spriteIndex)
|
||||
static void WindowResearchDrawTabImage(DrawPixelInfo& dpi, WindowBase* w, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_TAB_1 + page;
|
||||
|
||||
|
@ -608,12 +608,12 @@ static void WindowResearchDrawTabImage(DrawPixelInfo* dpi, WindowBase* w, int32_
|
|||
}
|
||||
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(spriteIndex),
|
||||
dpi, ImageId(spriteIndex),
|
||||
w->windowPos + ScreenCoordsXY{ w->widgets[widgetIndex].left, w->widgets[widgetIndex].top });
|
||||
}
|
||||
}
|
||||
|
||||
static void WindowResearchDrawTabImages(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowResearchDrawTabImages(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
WindowResearchDrawTabImage(dpi, w, WINDOW_RESEARCH_PAGE_DEVELOPMENT, SPR_TAB_FINANCES_RESEARCH_0);
|
||||
WindowResearchDrawTabImage(dpi, w, WINDOW_RESEARCH_PAGE_FUNDING, SPR_TAB_FINANCES_SUMMARY_0);
|
||||
|
|
|
@ -439,7 +439,7 @@ static void WindowRideMainUpdate(WindowBase* w);
|
|||
static void WindowRideMainTextinput(WindowBase* w, WidgetIndex widgetIndex, const char* text);
|
||||
static void WindowRideMainViewportRotate(WindowBase* w);
|
||||
static void WindowRideMainInvalidate(WindowBase* w);
|
||||
static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
static void WindowRideMainFollowRide(WindowBase* w);
|
||||
|
||||
static void WindowRideVehicleMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
|
@ -449,8 +449,8 @@ static void WindowRideVehicleDropdown(WindowBase* w, WidgetIndex widgetIndex, in
|
|||
static void WindowRideVehicleUpdate(WindowBase* w);
|
||||
static OpenRCT2String WindowRideVehicleTooltip(WindowBase* const w, const WidgetIndex widgetIndex, StringId fallback);
|
||||
static void WindowRideVehicleInvalidate(WindowBase* w);
|
||||
static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideVehicleScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex);
|
||||
static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
static void WindowRideVehicleScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex);
|
||||
|
||||
static void WindowRideOperatingMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
static void WindowRideOperatingResize(WindowBase* w);
|
||||
|
@ -461,7 +461,7 @@ static void WindowRideOperatingDropdown(WindowBase* w, WidgetIndex widgetIndex,
|
|||
static void WindowRideOperatingUpdate(WindowBase* w);
|
||||
static void WindowRideOperatingTextinput(WindowBase* w, WidgetIndex widgetIndex, const char* text);
|
||||
static void WindowRideOperatingInvalidate(WindowBase* w);
|
||||
static void WindowRideOperatingPaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideOperatingPaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
|
||||
static void WindowRideMaintenanceMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
static void WindowRideMaintenanceResize(WindowBase* w);
|
||||
|
@ -469,7 +469,7 @@ static void WindowRideMaintenanceMousedown(WindowBase* w, WidgetIndex widgetInde
|
|||
static void WindowRideMaintenanceDropdown(WindowBase* w, WidgetIndex widgetIndex, int32_t dropdownIndex);
|
||||
static void WindowRideMaintenanceUpdate(WindowBase* w);
|
||||
static void WindowRideMaintenanceInvalidate(WindowBase* w);
|
||||
static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
|
||||
static void WindowRideColourClose(WindowBase* w);
|
||||
static void WindowRideColourMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
|
@ -480,8 +480,8 @@ static void WindowRideColourUpdate(WindowBase* w);
|
|||
static void WindowRideColourTooldown(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void WindowRideColourTooldrag(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void WindowRideColourInvalidate(WindowBase* w);
|
||||
static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideColourScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex);
|
||||
static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
static void WindowRideColourScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex);
|
||||
|
||||
static void WindowRideMusicMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
static void WindowRideMusicResize(WindowBase* w);
|
||||
|
@ -489,7 +489,7 @@ static void WindowRideMusicMousedown(WindowBase* w, WidgetIndex widgetIndex, Wid
|
|||
static void WindowRideMusicDropdown(WindowBase* w, WidgetIndex widgetIndex, int32_t dropdownIndex);
|
||||
static void WindowRideMusicUpdate(WindowBase* w);
|
||||
static void WindowRideMusicInvalidate(WindowBase* w);
|
||||
static void WindowRideMusicPaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideMusicPaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
|
||||
static void WindowRideMeasurementsClose(WindowBase* w);
|
||||
static void WindowRideMeasurementsMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
|
@ -501,7 +501,7 @@ static void WindowRideMeasurementsTooldown(WindowBase* w, WidgetIndex widgetInde
|
|||
static void WindowRideMeasurementsTooldrag(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void WindowRideMeasurementsToolabort(WindowBase* w, WidgetIndex widgetIndex);
|
||||
static void WindowRideMeasurementsInvalidate(WindowBase* w);
|
||||
static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
|
||||
static void WindowRideGraphsMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
static void WindowRideGraphsResize(WindowBase* w);
|
||||
|
@ -511,8 +511,8 @@ static void WindowRideGraphsScrollgetheight(WindowBase* w, int32_t scrollIndex,
|
|||
static void WindowRideGraphs15(WindowBase* w, int32_t scrollIndex, int32_t scrollAreaType);
|
||||
static OpenRCT2String WindowRideGraphsTooltip(WindowBase* w, const WidgetIndex widgetIndex, const StringId fallback);
|
||||
static void WindowRideGraphsInvalidate(WindowBase* w);
|
||||
static void WindowRideGraphsPaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex);
|
||||
static void WindowRideGraphsPaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex);
|
||||
|
||||
static void WindowRideIncomeMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
static void WindowRideIncomeResize(WindowBase* w);
|
||||
|
@ -520,14 +520,14 @@ static void WindowRideIncomeMousedown(WindowBase* w, WidgetIndex widgetIndex, Wi
|
|||
static void WindowRideIncomeUpdate(WindowBase* w);
|
||||
static void WindowRideIncomeTextinput(WindowBase* w, WidgetIndex widgetIndex, const char* text);
|
||||
static void WindowRideIncomeInvalidate(WindowBase* w);
|
||||
static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
static bool WindowRideIncomeCanModifyPrimaryPrice(WindowBase* w);
|
||||
|
||||
static void WindowRideCustomerMouseup(WindowBase* w, WidgetIndex widgetIndex);
|
||||
static void WindowRideCustomerResize(WindowBase* w);
|
||||
static void WindowRideCustomerUpdate(WindowBase* w);
|
||||
static void WindowRideCustomerInvalidate(WindowBase* w);
|
||||
static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi);
|
||||
static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo& dpi);
|
||||
|
||||
static void WindowRideSetPage(WindowBase* w, int32_t page);
|
||||
|
||||
|
@ -862,7 +862,7 @@ static const RideObjectEntry* VehicleDropdownRideType = nullptr;
|
|||
static bool VehicleDropdownExpanded = false;
|
||||
static std::vector<VehicleTypeLabel> VehicleDropdownData;
|
||||
|
||||
static void WindowRideDrawTabImage(DrawPixelInfo* dpi, WindowBase* w, int32_t page, int32_t spriteIndex)
|
||||
static void WindowRideDrawTabImage(DrawPixelInfo& dpi, WindowBase* w, int32_t page, int32_t spriteIndex)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_TAB_1 + page;
|
||||
|
||||
|
@ -875,7 +875,7 @@ static void WindowRideDrawTabImage(DrawPixelInfo* dpi, WindowBase* w, int32_t pa
|
|||
}
|
||||
|
||||
const auto& widget = w->widgets[widgetIndex];
|
||||
GfxDrawSprite(*dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top });
|
||||
GfxDrawSprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -883,7 +883,7 @@ static void WindowRideDrawTabImage(DrawPixelInfo* dpi, WindowBase* w, int32_t pa
|
|||
*
|
||||
* rct2: 0x006B2E88
|
||||
*/
|
||||
static void WindowRideDrawTabMain(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowRideDrawTabMain(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast<int32_t>(WINDOW_RIDE_PAGE_MAIN);
|
||||
if (!WidgetIsDisabled(*w, widgetIndex))
|
||||
|
@ -912,7 +912,7 @@ static void WindowRideDrawTabMain(DrawPixelInfo* dpi, WindowBase* w)
|
|||
}
|
||||
|
||||
const auto& widget = w->widgets[widgetIndex];
|
||||
GfxDrawSprite(*dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top });
|
||||
GfxDrawSprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -921,7 +921,7 @@ static void WindowRideDrawTabMain(DrawPixelInfo* dpi, WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006B2B68
|
||||
*/
|
||||
static void WindowRideDrawTabVehicle(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowRideDrawTabVehicle(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast<int32_t>(WINDOW_RIDE_PAGE_VEHICLE);
|
||||
const auto& widget = w->widgets[widgetIndex];
|
||||
|
@ -937,7 +937,7 @@ static void WindowRideDrawTabVehicle(DrawPixelInfo* dpi, WindowBase* w)
|
|||
screenCoords += w->windowPos;
|
||||
|
||||
DrawPixelInfo clipDPI;
|
||||
if (!ClipDrawPixelInfo(&clipDPI, dpi, screenCoords, width, height))
|
||||
if (!ClipDrawPixelInfo(&clipDPI, &dpi, screenCoords, width, height))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -992,7 +992,7 @@ static void WindowRideDrawTabVehicle(DrawPixelInfo* dpi, WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006B2F42
|
||||
*/
|
||||
static void WindowRideDrawTabCustomer(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowRideDrawTabCustomer(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast<int32_t>(WINDOW_RIDE_PAGE_CUSTOMER);
|
||||
|
||||
|
@ -1006,7 +1006,7 @@ static void WindowRideDrawTabCustomer(DrawPixelInfo* dpi, WindowBase* w)
|
|||
spriteIndex += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1;
|
||||
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(spriteIndex, COLOUR_BRIGHT_RED, COLOUR_TEAL),
|
||||
dpi, ImageId(spriteIndex, COLOUR_BRIGHT_RED, COLOUR_TEAL),
|
||||
w->windowPos + ScreenCoordsXY{ widget.midX(), widget.bottom - 6 });
|
||||
}
|
||||
}
|
||||
|
@ -1015,7 +1015,7 @@ static void WindowRideDrawTabCustomer(DrawPixelInfo* dpi, WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006B2B35
|
||||
*/
|
||||
static void WindowRideDrawTabImages(DrawPixelInfo* dpi, WindowBase* w)
|
||||
static void WindowRideDrawTabImages(DrawPixelInfo& dpi, WindowBase* w)
|
||||
{
|
||||
WindowRideDrawTabVehicle(dpi, w);
|
||||
WindowRideDrawTabImage(dpi, w, WINDOW_RIDE_PAGE_OPERATING, SPR_TAB_GEARS_0);
|
||||
|
@ -2580,7 +2580,7 @@ static StringId WindowRideGetStatus(WindowBase* w, Formatter& ft)
|
|||
*
|
||||
* rct2: 0x006AEE73
|
||||
*/
|
||||
static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
Widget* widget;
|
||||
|
||||
|
@ -2592,7 +2592,7 @@ static void WindowRideMainPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
{
|
||||
WindowDrawViewport(dpi, *w);
|
||||
if (w->viewport->flags & VIEWPORT_FLAG_SOUND_ON)
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_HEARING_VIEWPORT), w->windowPos + ScreenCoordsXY{ 2, 2 });
|
||||
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), w->windowPos + ScreenCoordsXY{ 2, 2 });
|
||||
}
|
||||
|
||||
// View dropdown
|
||||
|
@ -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 });
|
||||
}
|
||||
|
||||
|
@ -2885,7 +2885,7 @@ static void WindowRideVehicleInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006B23DC
|
||||
*/
|
||||
static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowRideDrawTabImages(dpi, w);
|
||||
|
@ -2903,13 +2903,13 @@ static void WindowRideVehiclePaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
// Description
|
||||
auto ft = Formatter();
|
||||
ft.Add<StringId>(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<StringId>(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<int16_t>(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<int16_t>(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<int16_t>(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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2963,7 +2963,7 @@ struct VehicleDrawInfo
|
|||
*
|
||||
* rct2: 0x006B2502
|
||||
*/
|
||||
static void WindowRideVehicleScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex)
|
||||
static void WindowRideVehicleScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex)
|
||||
{
|
||||
auto ride = GetRide(w->rideId);
|
||||
if (ride == nullptr)
|
||||
|
@ -2972,7 +2972,7 @@ static void WindowRideVehicleScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int3
|
|||
const auto* rideEntry = ride->GetRideEntry();
|
||||
|
||||
// Background
|
||||
GfxFillRect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } }, PALETTE_INDEX_12);
|
||||
GfxFillRect(&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, PALETTE_INDEX_12);
|
||||
|
||||
Widget* widget = &window_ride_vehicle_widgets[WIDX_VEHICLE_TRAINS_PREVIEW];
|
||||
int32_t startX = std::max(2, (widget->width() - ((ride->NumTrains - 1) * 36)) / 2 - 25);
|
||||
|
@ -3038,7 +3038,7 @@ static void WindowRideVehicleScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int3
|
|||
|
||||
VehicleDrawInfo* current = nextSpriteToDraw;
|
||||
while (--current >= trainCarImages)
|
||||
GfxDrawSprite(*dpi, current->imageId, { current->x, current->y });
|
||||
GfxDrawSprite(dpi, current->imageId, { current->x, current->y });
|
||||
|
||||
startX += 36;
|
||||
}
|
||||
|
@ -3721,7 +3721,7 @@ static void WindowRideOperatingInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006B1001
|
||||
*/
|
||||
static void WindowRideOperatingPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideOperatingPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowRideDrawTabImages(dpi, w);
|
||||
|
@ -3732,7 +3732,7 @@ static void WindowRideOperatingPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
|
||||
// Horizontal rule between mode settings and depart settings
|
||||
GfxFillRectInset(
|
||||
dpi,
|
||||
&dpi,
|
||||
{ w->windowPos + ScreenCoordsXY{ window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].left + 4, 103 },
|
||||
w->windowPos + ScreenCoordsXY{ window_ride_operating_widgets[WIDX_PAGE_BACKGROUND].right - 5, 104 } },
|
||||
w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
@ -3743,7 +3743,7 @@ static void WindowRideOperatingPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
auto ft = Formatter();
|
||||
ft.Add<uint16_t>(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);
|
||||
}
|
||||
}
|
||||
|
@ -3784,9 +3784,9 @@ static void WindowRideLocateMechanic(WindowBase* w)
|
|||
* rct2: 0x006B7D08
|
||||
*/
|
||||
static void WindowRideMaintenanceDrawBar(
|
||||
WindowBase* w, DrawPixelInfo* dpi, const ScreenCoordsXY& coords, int32_t value, int32_t colour)
|
||||
WindowBase* w, DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t value, int32_t colour)
|
||||
{
|
||||
GfxFillRectInset(dpi, { coords, coords + ScreenCoordsXY{ 149, 8 } }, w->colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(&dpi, { coords, coords + ScreenCoordsXY{ 149, 8 } }, w->colours[1], INSET_RECT_F_30);
|
||||
if (colour & BAR_BLINK)
|
||||
{
|
||||
colour &= ~BAR_BLINK;
|
||||
|
@ -3797,7 +3797,7 @@ static void WindowRideMaintenanceDrawBar(
|
|||
value = ((186 * ((value * 2) & 0xFF)) >> 8) & 0xFF;
|
||||
if (value > 2)
|
||||
{
|
||||
GfxFillRectInset(dpi, { coords + ScreenCoordsXY{ 2, 1 }, coords + ScreenCoordsXY{ value + 1, 7 } }, colour, 0);
|
||||
GfxFillRectInset(&dpi, { coords + ScreenCoordsXY{ 2, 1 }, coords + ScreenCoordsXY{ value + 1, 7 } }, colour, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4117,7 +4117,7 @@ static void WindowRideMaintenanceInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006B1877
|
||||
*/
|
||||
static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowRideDrawTabImages(dpi, w);
|
||||
|
@ -4130,12 +4130,12 @@ static void WindowRideMaintenancePaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
Widget* widget = &window_ride_maintenance_widgets[WIDX_LOCATE_MECHANIC];
|
||||
auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top };
|
||||
auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, gStaffMechanicColour);
|
||||
GfxDrawSprite(*dpi, image, screenCoords);
|
||||
GfxDrawSprite(dpi, image, screenCoords);
|
||||
|
||||
// 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<uint16_t>(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<int32_t>(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<uint16_t>(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<uint16_t>(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<StringId>(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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4876,7 +4876,7 @@ static void WindowRideColourInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006AFF3E
|
||||
*/
|
||||
static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
// TODO: This should use lists and identified sprites
|
||||
DrawPixelInfo clippedDpi;
|
||||
|
@ -4892,7 +4892,7 @@ static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
const auto& trackPreviewWidget = window_ride_colour_widgets[WIDX_TRACK_PREVIEW];
|
||||
if (trackPreviewWidget.type != WindowWidgetType::Empty)
|
||||
GfxFillRect(
|
||||
dpi,
|
||||
&dpi,
|
||||
{ { w->windowPos + ScreenCoordsXY{ trackPreviewWidget.left + 1, trackPreviewWidget.top + 1 } },
|
||||
{ w->windowPos + ScreenCoordsXY{ trackPreviewWidget.right - 1, trackPreviewWidget.bottom - 1 } } },
|
||||
PALETTE_INDEX_12);
|
||||
|
@ -4909,7 +4909,7 @@ static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
{
|
||||
GfxDrawSprite(*dpi, ImageId(MazeOptions[trackColour.supports].sprite), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(MazeOptions[trackColour.supports].sprite), screenCoords);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4917,14 +4917,14 @@ static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
int32_t spriteIndex = typeDescriptor.ColourPreview.Track;
|
||||
if (spriteIndex != 0)
|
||||
{
|
||||
GfxDrawSprite(*dpi, ImageId(spriteIndex, trackColour.main, trackColour.additional), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(spriteIndex, trackColour.main, trackColour.additional), screenCoords);
|
||||
}
|
||||
|
||||
// Supports
|
||||
spriteIndex = typeDescriptor.ColourPreview.Supports;
|
||||
if (spriteIndex != 0)
|
||||
{
|
||||
GfxDrawSprite(*dpi, ImageId(spriteIndex, trackColour.supports), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(spriteIndex, trackColour.supports), screenCoords);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4948,11 +4948,11 @@ static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
}
|
||||
}
|
||||
|
||||
GfxDrawSprite(*dpi, ImageId(GetShopItemDescriptor(shopItem).Image, spriteColour), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, spriteColour), screenCoords);
|
||||
}
|
||||
else
|
||||
{
|
||||
GfxDrawSprite(*dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->track_colour[0].main), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->track_colour[0].main), screenCoords);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4962,7 +4962,7 @@ static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
if (entrancePreviewWidget.type != WindowWidgetType::Empty)
|
||||
{
|
||||
if (ClipDrawPixelInfo(
|
||||
&clippedDpi, dpi,
|
||||
&clippedDpi, &dpi,
|
||||
w->windowPos + ScreenCoordsXY{ entrancePreviewWidget.left + 1, entrancePreviewWidget.top + 1 },
|
||||
entrancePreviewWidget.width(), entrancePreviewWidget.height()))
|
||||
{
|
||||
|
@ -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, {});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4996,7 +4996,7 @@ static void WindowRideColourPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
*
|
||||
* rct2: 0x006B0192
|
||||
*/
|
||||
static void WindowRideColourScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex)
|
||||
static void WindowRideColourScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex)
|
||||
{
|
||||
auto ride = GetRide(w->rideId);
|
||||
if (ride == nullptr)
|
||||
|
@ -5010,7 +5010,7 @@ static void WindowRideColourScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
|
|||
auto vehicleColour = RideGetVehicleColour(*ride, w->vehicleIndex);
|
||||
|
||||
// Background colour
|
||||
GfxFillRect(dpi, { { dpi->x, dpi->y }, { dpi->x + dpi->width - 1, dpi->y + dpi->height - 1 } }, PALETTE_INDEX_12);
|
||||
GfxFillRect(&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, PALETTE_INDEX_12);
|
||||
|
||||
// ?
|
||||
auto screenCoords = ScreenCoordsXY{ vehiclePreviewWidget->width() / 2, vehiclePreviewWidget->height() - 15 };
|
||||
|
@ -5031,7 +5031,7 @@ static void WindowRideColourScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
|
|||
imageIndex *= carEntry.base_num_frames;
|
||||
imageIndex += carEntry.base_image_id;
|
||||
auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary);
|
||||
GfxDrawSprite(*dpi, imageId, screenCoords);
|
||||
GfxDrawSprite(dpi, imageId, screenCoords);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
@ -5259,7 +5259,7 @@ static void WindowRideMusicInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006B1ECC
|
||||
*/
|
||||
static void WindowRideMusicPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideMusicPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowRideDrawTabImages(dpi, w);
|
||||
|
@ -5639,7 +5639,7 @@ static void WindowRideMeasurementsInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006ACF07
|
||||
*/
|
||||
static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowRideDrawTabImages(dpi, w);
|
||||
|
@ -5649,12 +5649,12 @@ 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;
|
||||
GfxFillRectInset(
|
||||
dpi, { widgetCoords, { w->windowPos.x + 312, widgetCoords.y + 1 } }, w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
||||
&dpi, { widgetCoords, { w->windowPos.x + 312, widgetCoords.y + 1 } }, w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5674,7 +5674,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
ft.Add<uint32_t>(ride->excitement);
|
||||
ft.Add<StringId>(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,12 +5698,12 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
ft.Add<uint32_t>(ride->nausea);
|
||||
ft.Add<StringId>(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
|
||||
GfxFillRectInset(
|
||||
dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 303, -5 } }, w->colours[1],
|
||||
&dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 303, -5 } }, w->colours[1],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_NO_RAW_STATS))
|
||||
|
@ -5713,7 +5713,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
// Holes
|
||||
ft = Formatter();
|
||||
ft.Add<uint16_t>(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<int32_t>((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<int32_t>((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<uint16_t>(0);
|
||||
ft.Add<uint16_t>(0);
|
||||
ft.Add<uint16_t>(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<uint16_t>(0);
|
||||
ft.Add<uint16_t>(0);
|
||||
ft.Add<uint16_t>(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<fixed16_2dp>(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<int32_t>(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<fixed16_2dp>(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<fixed32_2dp>(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<uint16_t>(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<int32_t>(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<uint16_t>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6126,7 +6126,7 @@ static void WindowRideGraphsInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006AE4BC
|
||||
*/
|
||||
static void WindowRideGraphsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideGraphsPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
WindowDrawWidgets(*w, dpi);
|
||||
WindowRideDrawTabImages(dpi, w);
|
||||
|
@ -6136,9 +6136,9 @@ static void WindowRideGraphsPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
*
|
||||
* rct2: 0x006AE4C7
|
||||
*/
|
||||
static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex)
|
||||
static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex)
|
||||
{
|
||||
GfxClear(dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker);
|
||||
GfxClear(&dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker);
|
||||
|
||||
auto widget = &window_ride_graphs_widgets[WIDX_GRAPH];
|
||||
auto ride = GetRide(w->rideId);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -6163,17 +6163,17 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
|
|||
const uint8_t darkColour = ColourMapA[COLOUR_SATURATED_GREEN].mid_dark;
|
||||
|
||||
int32_t time = 0;
|
||||
for (int32_t x = 0; x < dpi->x + dpi->width; x += 80)
|
||||
for (int32_t x = 0; x < dpi.x + dpi.width; x += 80)
|
||||
{
|
||||
if (x + 80 >= dpi->x)
|
||||
if (x + 80 >= dpi.x)
|
||||
{
|
||||
auto coord1 = ScreenCoordsXY{ x, dpi->y };
|
||||
auto coord2 = ScreenCoordsXY{ x, dpi->y + dpi->height - 1 };
|
||||
GfxFillRect(dpi, { coord1, coord2 }, lightColour);
|
||||
GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 16, 0 }, coord2 + ScreenCoordsXY{ 16, 0 } }, darkColour);
|
||||
GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 32, 0 }, coord2 + ScreenCoordsXY{ 32, 0 } }, darkColour);
|
||||
GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 48, 0 }, coord2 + ScreenCoordsXY{ 48, 0 } }, darkColour);
|
||||
GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 64, 0 }, coord2 + ScreenCoordsXY{ 64, 0 } }, darkColour);
|
||||
auto coord1 = ScreenCoordsXY{ x, dpi.y };
|
||||
auto coord2 = ScreenCoordsXY{ x, dpi.y + dpi.height - 1 };
|
||||
GfxFillRect(&dpi, { coord1, coord2 }, lightColour);
|
||||
GfxFillRect(&dpi, { coord1 + ScreenCoordsXY{ 16, 0 }, coord2 + ScreenCoordsXY{ 16, 0 } }, darkColour);
|
||||
GfxFillRect(&dpi, { coord1 + ScreenCoordsXY{ 32, 0 }, coord2 + ScreenCoordsXY{ 32, 0 } }, darkColour);
|
||||
GfxFillRect(&dpi, { coord1 + ScreenCoordsXY{ 48, 0 }, coord2 + ScreenCoordsXY{ 48, 0 } }, darkColour);
|
||||
GfxFillRect(&dpi, { coord1 + ScreenCoordsXY{ 64, 0 }, coord2 + ScreenCoordsXY{ 64, 0 } }, darkColour);
|
||||
}
|
||||
time += 5;
|
||||
}
|
||||
|
@ -6195,7 +6195,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
|
|||
{
|
||||
// Minor / major line
|
||||
int32_t colour = yUnit == 0 ? lightColour : darkColour;
|
||||
GfxFillRect(dpi, { { dpi->x, y }, { dpi->x + dpi->width - 1, y } }, colour);
|
||||
GfxFillRect(&dpi, { { dpi.x, y }, { dpi.x + dpi.width - 1, y } }, colour);
|
||||
|
||||
int16_t scaled_yUnit = yUnit;
|
||||
// Scale modifier
|
||||
|
@ -6205,27 +6205,27 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
|
|||
auto ft = Formatter();
|
||||
ft.Add<int16_t>(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
|
||||
time = 0;
|
||||
for (int32_t x = 0; x < dpi->x + dpi->width; x += 80)
|
||||
for (int32_t x = 0; x < dpi.x + dpi.width; x += 80)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<int32_t>(time);
|
||||
if (x + 80 >= dpi->x)
|
||||
DrawTextBasic(*dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small });
|
||||
if (x + 80 >= dpi.x)
|
||||
DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small });
|
||||
time += 5;
|
||||
}
|
||||
|
||||
// Plot
|
||||
int32_t x = dpi->x;
|
||||
int32_t x = dpi.x;
|
||||
int32_t firstPoint, secondPoint;
|
||||
// Uses the force limits (used to draw extreme G's in red on measurement tab) to determine if line should be drawn red.
|
||||
int32_t intensityThresholdPositive = 0;
|
||||
int32_t intensityThresholdNegative = 0;
|
||||
for (int32_t width = 0; width < dpi->width; width++, x++)
|
||||
for (int32_t width = 0; width < dpi.width; width++, x++)
|
||||
{
|
||||
if (x < 0 || x >= measurement->num_items - 1)
|
||||
continue;
|
||||
|
@ -6278,7 +6278,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
|
|||
const bool previousMeasurement = x > measurement->current_item;
|
||||
|
||||
// Draw the current line in grey.
|
||||
GfxFillRect(dpi, { { x, firstPoint }, { x, secondPoint } }, previousMeasurement ? PALETTE_INDEX_17 : PALETTE_INDEX_21);
|
||||
GfxFillRect(&dpi, { { x, firstPoint }, { x, secondPoint } }, previousMeasurement ? PALETTE_INDEX_17 : PALETTE_INDEX_21);
|
||||
|
||||
// Draw red over extreme values (if supported by graph type).
|
||||
if (listType == GRAPH_VERTICAL || listType == GRAPH_LATERAL)
|
||||
|
@ -6290,7 +6290,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
|
|||
{
|
||||
const auto redLineTop = ScreenCoordsXY{ x, std::max(firstPoint, intensityThresholdNegative) };
|
||||
const auto redLineBottom = ScreenCoordsXY{ x, std::max(secondPoint, intensityThresholdNegative) };
|
||||
GfxFillRect(dpi, { redLineTop, redLineBottom }, redLineColour);
|
||||
GfxFillRect(&dpi, { redLineTop, redLineBottom }, redLineColour);
|
||||
}
|
||||
|
||||
// Line exceeds positive threshold (at top of graph).
|
||||
|
@ -6298,7 +6298,7 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo* dpi, int32
|
|||
{
|
||||
const auto redLineTop = ScreenCoordsXY{ x, std::min(firstPoint, intensityThresholdPositive) };
|
||||
const auto redLineBottom = ScreenCoordsXY{ x, std::min(secondPoint, intensityThresholdPositive) };
|
||||
GfxFillRect(dpi, { redLineTop, redLineBottom }, redLineColour);
|
||||
GfxFillRect(&dpi, { redLineTop, redLineBottom }, redLineColour);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6742,7 +6742,7 @@ static void WindowRideIncomeInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006ADCE5
|
||||
*/
|
||||
static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
StringId stringId;
|
||||
money64 profit;
|
||||
|
@ -6780,7 +6780,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
auto ft = Formatter();
|
||||
ft.Add<money64>(profit);
|
||||
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft);
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft);
|
||||
}
|
||||
screenCoords.y += 44;
|
||||
|
||||
|
@ -6804,7 +6804,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
auto ft = Formatter();
|
||||
ft.Add<money64>(profit);
|
||||
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft);
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft);
|
||||
}
|
||||
screenCoords.y += 18;
|
||||
|
||||
|
@ -6814,7 +6814,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
auto ft = Formatter();
|
||||
ft.Add<money64>(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;
|
||||
}
|
||||
|
||||
|
@ -6823,7 +6823,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
stringId = ride->upkeep_cost == MONEY64_UNDEFINED ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR;
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(costPerHour);
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft);
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Profit per hour
|
||||
|
@ -6831,7 +6831,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
{
|
||||
ft = Formatter();
|
||||
ft.Add<money64>(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;
|
||||
|
@ -6839,7 +6839,7 @@ static void WindowRideIncomePaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
// Total profit
|
||||
ft = Formatter();
|
||||
ft.Add<money64>(ride->total_profit);
|
||||
DrawTextBasic(*dpi, screenCoords, STR_TOTAL_PROFIT, ft);
|
||||
DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, ft);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
@ -6969,7 +6969,7 @@ static void WindowRideCustomerInvalidate(WindowBase* w)
|
|||
*
|
||||
* rct2: 0x006AD6CD
|
||||
*/
|
||||
static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
|
||||
static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
ShopItem shopItem;
|
||||
int16_t popularity, satisfaction, queueTime;
|
||||
|
@ -6991,14 +6991,14 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<int16_t>(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<int32_t>(RideCustomersPerHour(*ride));
|
||||
DrawTextBasic(*dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft);
|
||||
DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Popularity
|
||||
|
@ -7014,7 +7014,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
}
|
||||
ft = Formatter();
|
||||
ft.Add<int16_t>(popularity);
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft);
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Satisfaction
|
||||
|
@ -7030,7 +7030,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
}
|
||||
ft = Formatter();
|
||||
ft.Add<int16_t>(satisfaction);
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft);
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Queue time
|
||||
|
@ -7040,7 +7040,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
stringId = queueTime == 1 ? STR_QUEUE_TIME_MINUTE : STR_QUEUE_TIME_MINUTES;
|
||||
ft = Formatter();
|
||||
ft.Add<int32_t>(queueTime);
|
||||
screenCoords.y += DrawTextWrapped(*dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT });
|
||||
screenCoords.y += DrawTextWrapped(dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT });
|
||||
screenCoords.y += 5;
|
||||
}
|
||||
|
||||
|
@ -7051,7 +7051,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
ft = Formatter();
|
||||
ft.Add<StringId>(GetShopItemDescriptor(shopItem).Naming.Plural);
|
||||
ft.Add<uint32_t>(ride->no_primary_items_sold);
|
||||
DrawTextBasic(*dpi, screenCoords, STR_ITEMS_SOLD, ft);
|
||||
DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
@ -7063,14 +7063,14 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
ft = Formatter();
|
||||
ft.Add<StringId>(GetShopItemDescriptor(shopItem).Naming.Plural);
|
||||
ft.Add<uint32_t>(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<uint32_t>(ride->total_customers);
|
||||
DrawTextBasic(*dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft);
|
||||
DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
||||
// Guests favourite
|
||||
|
@ -7079,7 +7079,7 @@ static void WindowRideCustomerPaint(WindowBase* w, DrawPixelInfo* dpi)
|
|||
ft = Formatter();
|
||||
ft.Add<uint32_t>(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;
|
||||
|
@ -7090,7 +7090,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<int16_t>(age);
|
||||
DrawTextBasic(*dpi, screenCoords, stringId, ft);
|
||||
DrawTextBasic(dpi, screenCoords, stringId, ft);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
|
|
@ -1519,7 +1519,7 @@ public:
|
|||
widgetHeight = widget->height() - 1;
|
||||
if (ClipDrawPixelInfo(&clipdpi, &dpi, screenCoords, widgetWidth, widgetHeight))
|
||||
{
|
||||
DrawTrackPiece(&clipdpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, widgetWidth, widgetHeight);
|
||||
DrawTrackPiece(clipdpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, widgetWidth, widgetHeight);
|
||||
}
|
||||
|
||||
// Draw cost
|
||||
|
@ -2624,7 +2624,7 @@ private:
|
|||
}
|
||||
|
||||
void DrawTrackPiece(
|
||||
DrawPixelInfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState,
|
||||
DrawPixelInfo& dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState,
|
||||
int32_t widgetWidth, int32_t widgetHeight)
|
||||
{
|
||||
auto currentRide = GetRide(rideIndex);
|
||||
|
@ -2656,20 +2656,20 @@ private:
|
|||
|
||||
const ScreenCoordsXY rotatedScreenCoords = Translate3DTo2DWithZ(GetCurrentRotation(), mapCoords);
|
||||
|
||||
dpi->x += rotatedScreenCoords.x - widgetWidth / 2;
|
||||
dpi->y += rotatedScreenCoords.y - widgetHeight / 2 - 16;
|
||||
dpi.x += rotatedScreenCoords.x - widgetWidth / 2;
|
||||
dpi.y += rotatedScreenCoords.y - widgetHeight / 2 - 16;
|
||||
|
||||
DrawTrackPieceHelper(dpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, { 4096, 4096 }, 1024);
|
||||
}
|
||||
|
||||
void DrawTrackPieceHelper(
|
||||
DrawPixelInfo* dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState,
|
||||
DrawPixelInfo& dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState,
|
||||
const CoordsXY& originCoords, int32_t originZ)
|
||||
{
|
||||
TileElement tempSideTrackTileElement{ 0x80, 0x8F, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
TileElement tempTrackTileElement{};
|
||||
TileElement* backupTileElementArrays[5]{};
|
||||
PaintSession* session = PaintSessionAlloc(dpi, 0);
|
||||
PaintSession* session = PaintSessionAlloc(&dpi, 0);
|
||||
trackDirection &= 3;
|
||||
|
||||
auto currentRide = GetRide(rideIndex);
|
||||
|
|
|
@ -509,8 +509,8 @@ public:
|
|||
*/
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
DrawTabImages(&dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
// Draw number of attractions on bottom
|
||||
auto ft = Formatter();
|
||||
|
@ -739,7 +739,7 @@ private:
|
|||
*
|
||||
* rct2: 0x006B38EA
|
||||
*/
|
||||
void DrawTabImages(DrawPixelInfo* dpi)
|
||||
void DrawTabImages(DrawPixelInfo& dpi)
|
||||
{
|
||||
int32_t sprite_idx;
|
||||
|
||||
|
@ -748,21 +748,21 @@ private:
|
|||
if (page == PAGE_RIDES)
|
||||
sprite_idx += frame_no / 4;
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top });
|
||||
dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top });
|
||||
|
||||
// Shops and stalls tab
|
||||
sprite_idx = SPR_TAB_SHOPS_AND_STALLS_0;
|
||||
if (page == PAGE_SHOPS_AND_STALLS)
|
||||
sprite_idx += frame_no / 4;
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top });
|
||||
dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top });
|
||||
|
||||
// Information kiosks and facilities tab
|
||||
sprite_idx = SPR_TAB_KIOSKS_AND_FACILITIES_0;
|
||||
if (page == PAGE_KIOSKS_AND_FACILITIES)
|
||||
sprite_idx += (frame_no / 4) % 8;
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top });
|
||||
dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -178,7 +178,7 @@ public:
|
|||
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
|
||||
// Draw area as a number for tool sizes bigger than 7
|
||||
if (gWindowSceneryScatterSize > MAX_TOOL_SIZE_WITH_SPRITE)
|
||||
|
|
|
@ -293,7 +293,7 @@ public:
|
|||
|
||||
if (viewport != nullptr)
|
||||
{
|
||||
WindowDrawViewport(&dpi, *this);
|
||||
WindowDrawViewport(dpi, *this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -206,15 +206,15 @@ public:
|
|||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
DrawWidgets(dpi);
|
||||
DrawTabImages(&dpi);
|
||||
DrawTabImages(dpi);
|
||||
|
||||
switch (page)
|
||||
{
|
||||
case WINDOW_STAFF_OVERVIEW:
|
||||
OverviewDraw(&dpi);
|
||||
OverviewDraw(dpi);
|
||||
break;
|
||||
case WINDOW_STAFF_STATISTICS:
|
||||
StatsDraw(&dpi);
|
||||
StatsDraw(dpi);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ private:
|
|||
widgets[WIDX_FIRE].right = width - 2;
|
||||
}
|
||||
|
||||
void OverviewDraw(DrawPixelInfo* dpi)
|
||||
void OverviewDraw(DrawPixelInfo& dpi)
|
||||
{
|
||||
// Draw the viewport no sound sprite
|
||||
if (viewport != nullptr)
|
||||
|
@ -522,7 +522,7 @@ private:
|
|||
|
||||
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
|
||||
{
|
||||
GfxDrawSprite(*dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
|
||||
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -537,10 +537,10 @@ 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)
|
||||
void DrawOverviewTabImage(DrawPixelInfo& dpi)
|
||||
{
|
||||
if (IsWidgetDisabled(WIDX_TAB_1))
|
||||
return;
|
||||
|
@ -553,7 +553,7 @@ private:
|
|||
widgetHeight++;
|
||||
|
||||
DrawPixelInfo clip_dpi;
|
||||
if (!ClipDrawPixelInfo(&clip_dpi, dpi, screenCoords, widgetWidth, widgetHeight))
|
||||
if (!ClipDrawPixelInfo(&clip_dpi, &dpi, screenCoords, widgetWidth, widgetHeight))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -914,7 +914,7 @@ private:
|
|||
#pragma endregion
|
||||
|
||||
#pragma region Statistics tab events
|
||||
void StatsDraw(DrawPixelInfo* dpi)
|
||||
void StatsDraw(DrawPixelInfo& dpi)
|
||||
{
|
||||
auto staff = GetStaff();
|
||||
if (staff == nullptr)
|
||||
|
@ -928,13 +928,13 @@ private:
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(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<int32_t>(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<uint32_t>(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<uint32_t>(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<uint32_t>(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<uint32_t>(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<uint32_t>(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<uint32_t>(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<uint32_t>(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:
|
||||
|
@ -1192,14 +1192,14 @@ private:
|
|||
WindowFollowSprite(*main, EntityId::FromUnderlying(number));
|
||||
}
|
||||
|
||||
void DrawTabImages(DrawPixelInfo* dpi)
|
||||
void DrawTabImages(DrawPixelInfo& dpi)
|
||||
{
|
||||
DrawOverviewTabImage(dpi);
|
||||
DrawTabImage(dpi, WINDOW_STAFF_OPTIONS, SPR_TAB_STAFF_OPTIONS_0);
|
||||
DrawTabImage(dpi, WINDOW_STAFF_STATISTICS, SPR_TAB_STATS_0);
|
||||
}
|
||||
|
||||
void DrawTabImage(DrawPixelInfo* dpi, int32_t p, int32_t baseImageId)
|
||||
void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t baseImageId)
|
||||
{
|
||||
WidgetIndex widgetIndex = WIDX_TAB_1 + p;
|
||||
Widget* widget = &widgets[widgetIndex];
|
||||
|
@ -1215,7 +1215,7 @@ private:
|
|||
}
|
||||
|
||||
// Draw normal, enabled sprite.
|
||||
GfxDrawSprite(*dpi, ImageId(baseImageId), screenCoords);
|
||||
GfxDrawSprite(dpi, ImageId(baseImageId), screenCoords);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -447,8 +447,8 @@ public:
|
|||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
// Widgets
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowThemesDrawTabImages(&dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
WindowThemesDrawTabImages(dpi);
|
||||
|
||||
if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS)
|
||||
{
|
||||
|
@ -868,7 +868,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void WindowThemesDrawTabImages(DrawPixelInfo* dpi)
|
||||
void WindowThemesDrawTabImages(DrawPixelInfo& dpi)
|
||||
{
|
||||
for (int32_t i = 0; i < WINDOW_THEMES_TAB_COUNT; i++)
|
||||
{
|
||||
|
@ -876,7 +876,7 @@ public:
|
|||
if (_selected_tab == i)
|
||||
sprite_idx += frame_no / window_themes_tab_animation_divisor[_selected_tab];
|
||||
GfxDrawSprite(
|
||||
*dpi, ImageId(sprite_idx),
|
||||
dpi, ImageId(sprite_idx),
|
||||
windowPos
|
||||
+ ScreenCoordsXY{ widgets[WIDX_THEMES_SETTINGS_TAB + i].left, widgets[WIDX_THEMES_SETTINGS_TAB + i].top });
|
||||
}
|
||||
|
|
|
@ -3180,7 +3180,7 @@ public:
|
|||
{
|
||||
int32_t imgId;
|
||||
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
|
||||
ScreenCoordsXY screenPos{};
|
||||
// Draw staff button image (setting masks to the staff colours)
|
||||
|
|
|
@ -288,7 +288,7 @@ public:
|
|||
{
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<char*>(_trackDesign->name.c_str());
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
|
||||
// Draw mini tile preview
|
||||
DrawPixelInfo clippedDpi;
|
||||
|
|
|
@ -274,7 +274,7 @@ public:
|
|||
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
WindowDrawWidgets(*this, &dpi);
|
||||
WindowDrawWidgets(*this, dpi);
|
||||
|
||||
// Clip height value
|
||||
auto screenCoords = this->windowPos + ScreenCoordsXY{ 8, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top };
|
||||
|
|
|
@ -156,7 +156,7 @@ public:
|
|||
|
||||
// Draw viewport
|
||||
if (viewport != nullptr)
|
||||
WindowDrawViewport(&dpi, *this);
|
||||
WindowDrawViewport(dpi, *this);
|
||||
}
|
||||
|
||||
void OnResize() override
|
||||
|
|
|
@ -120,8 +120,8 @@ WindowBase* WindowMapOpen();
|
|||
void WindowMapReset();
|
||||
|
||||
WindowBase* WindowResearchOpen();
|
||||
void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo* dpi, WidgetIndex baseWidgetIndex);
|
||||
void WindowResearchFundingPagePaint(WindowBase* w, DrawPixelInfo* dpi, WidgetIndex baseWidgetIndex);
|
||||
void WindowResearchDevelopmentPagePaint(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex);
|
||||
void WindowResearchFundingPagePaint(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex);
|
||||
|
||||
WindowBase* WindowNewRideOpen();
|
||||
WindowBase* WindowNewRideOpenResearch();
|
||||
|
|
|
@ -437,7 +437,7 @@ void X8DrawingEngine::DrawDirtyBlocks(uint32_t x, uint32_t y, uint32_t columns,
|
|||
|
||||
// Draw region
|
||||
OnDrawDirtyBlock(x, y, columns, rows);
|
||||
WindowDrawAll(&_bitsDPI, left, top, right, bottom);
|
||||
WindowDrawAll(_bitsDPI, left, top, right, bottom);
|
||||
}
|
||||
|
||||
#ifdef __WARN_SUGGEST_FINAL_METHODS__
|
||||
|
|
|
@ -370,14 +370,14 @@ static void ViewportRedrawAfterShift(DrawPixelInfo* dpi, WindowBase* window, Vie
|
|||
{
|
||||
// draw left
|
||||
auto _right = viewport->pos.x + coords.x;
|
||||
WindowDrawAll(dpi, left, top, _right, bottom);
|
||||
WindowDrawAll(*dpi, left, top, _right, bottom);
|
||||
left += coords.x;
|
||||
}
|
||||
else if (coords.x < 0)
|
||||
{
|
||||
// draw right
|
||||
auto _left = viewport->pos.x + viewport->width + coords.x;
|
||||
WindowDrawAll(dpi, _left, top, right, bottom);
|
||||
WindowDrawAll(*dpi, _left, top, right, bottom);
|
||||
right += coords.x;
|
||||
}
|
||||
|
||||
|
@ -385,19 +385,19 @@ static void ViewportRedrawAfterShift(DrawPixelInfo* dpi, WindowBase* window, Vie
|
|||
{
|
||||
// draw top
|
||||
bottom = viewport->pos.y + coords.y;
|
||||
WindowDrawAll(dpi, left, top, right, bottom);
|
||||
WindowDrawAll(*dpi, left, top, right, bottom);
|
||||
}
|
||||
else if (coords.y < 0)
|
||||
{
|
||||
// draw bottom
|
||||
top = viewport->pos.y + viewport->height + coords.y;
|
||||
WindowDrawAll(dpi, left, top, right, bottom);
|
||||
WindowDrawAll(*dpi, left, top, right, bottom);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// redraw whole viewport
|
||||
WindowDrawAll(dpi, left, top, right, bottom);
|
||||
WindowDrawAll(*dpi, left, top, right, bottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ static void ViewportShiftPixels(DrawPixelInfo* dpi, WindowBase* window, Viewport
|
|||
if (top >= bottom)
|
||||
continue;
|
||||
|
||||
WindowDrawAll(dpi, left, top, right, bottom);
|
||||
WindowDrawAll(*dpi, left, top, right, bottom);
|
||||
}
|
||||
|
||||
ViewportRedrawAfterShift(dpi, window, viewport, { x_diff, y_diff });
|
||||
|
@ -480,7 +480,7 @@ static void ViewportMove(const ScreenCoordsXY& coords, WindowBase* w, Viewport*
|
|||
if (DrawingEngineHasDirtyOptimisations())
|
||||
{
|
||||
DrawPixelInfo* dpi = DrawingEngineGetDpi();
|
||||
WindowDrawAll(dpi, left, top, right, bottom);
|
||||
WindowDrawAll(*dpi, left, top, right, bottom);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace WindowCloseFlags
|
|||
static constexpr uint32_t CloseSingle = (1 << 1);
|
||||
} // namespace WindowCloseFlags
|
||||
|
||||
static void WindowDrawCore(DrawPixelInfo* dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
static void WindowDrawCore(DrawPixelInfo& dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
static void WindowDrawSingle(DrawPixelInfo* dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
|
||||
std::list<std::shared_ptr<WindowBase>>::iterator WindowGetIterator(const WindowBase* w)
|
||||
|
@ -1130,7 +1130,7 @@ void MainWindowZoom(bool zoomIn, bool atCursor)
|
|||
* Splits a drawing of a window into regions that can be seen and are not hidden
|
||||
* by other opaque overlapping windows.
|
||||
*/
|
||||
void WindowDraw(DrawPixelInfo* dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
void WindowDraw(DrawPixelInfo& dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
{
|
||||
if (!WindowIsVisible(w))
|
||||
return;
|
||||
|
@ -1185,7 +1185,7 @@ void WindowDraw(DrawPixelInfo* dpi, WindowBase& w, int32_t left, int32_t top, in
|
|||
/**
|
||||
* Draws the given window and any other overlapping transparent windows.
|
||||
*/
|
||||
static void WindowDrawCore(DrawPixelInfo* dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
static void WindowDrawCore(DrawPixelInfo& dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
{
|
||||
// Clamp region
|
||||
left = std::max<int32_t>(left, w.windowPos.x);
|
||||
|
@ -1203,7 +1203,7 @@ static void WindowDrawCore(DrawPixelInfo* dpi, WindowBase& w, int32_t left, int3
|
|||
auto* v = (*it).get();
|
||||
if ((&w == v || (v->flags & WF_TRANSPARENT)) && WindowIsVisible(*v))
|
||||
{
|
||||
WindowDrawSingle(dpi, *v, left, top, right, bottom);
|
||||
WindowDrawSingle(&dpi, *v, left, top, right, bottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1266,7 +1266,7 @@ static void WindowDrawSingle(DrawPixelInfo* dpi, WindowBase& w, int32_t left, in
|
|||
gCurrentWindowColours[2] = NOT_TRANSLUCENT(w.colours[2]);
|
||||
gCurrentWindowColours[3] = NOT_TRANSLUCENT(w.colours[3]);
|
||||
|
||||
WindowEventPaintCall(&w, dpi);
|
||||
WindowEventPaintCall(&w, *dpi);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1276,9 +1276,9 @@ static void WindowDrawSingle(DrawPixelInfo* dpi, WindowBase& w, int32_t left, in
|
|||
* @param dpi (edi)
|
||||
* @param w (esi)
|
||||
*/
|
||||
void WindowDrawViewport(DrawPixelInfo* dpi, WindowBase& w)
|
||||
void WindowDrawViewport(DrawPixelInfo& dpi, WindowBase& w)
|
||||
{
|
||||
ViewportRender(dpi, w.viewport, { { dpi->x, dpi->y }, { dpi->x + dpi->width, dpi->y + dpi->height } });
|
||||
ViewportRender(&dpi, w.viewport, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } });
|
||||
}
|
||||
|
||||
void WindowSetPosition(WindowBase& w, const ScreenCoordsXY& screenCoords)
|
||||
|
@ -1647,18 +1647,18 @@ void WindowEventInvalidateCall(WindowBase* w)
|
|||
w->event_handlers->invalidate(w);
|
||||
}
|
||||
|
||||
void WindowEventPaintCall(WindowBase* w, DrawPixelInfo* dpi)
|
||||
void WindowEventPaintCall(WindowBase* w, DrawPixelInfo& dpi)
|
||||
{
|
||||
if (w->event_handlers == nullptr)
|
||||
w->OnDraw(*dpi);
|
||||
w->OnDraw(dpi);
|
||||
else if (w->event_handlers->paint != nullptr)
|
||||
w->event_handlers->paint(w, dpi);
|
||||
}
|
||||
|
||||
void WindowEventScrollPaintCall(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex)
|
||||
void WindowEventScrollPaintCall(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex)
|
||||
{
|
||||
if (w->event_handlers == nullptr)
|
||||
w->OnScrollDraw(scrollIndex, *dpi);
|
||||
w->OnScrollDraw(scrollIndex, dpi);
|
||||
else if (w->event_handlers->scroll_paint != nullptr)
|
||||
w->event_handlers->scroll_paint(w, dpi, scrollIndex);
|
||||
}
|
||||
|
@ -2089,9 +2089,9 @@ bool WindowIsVisible(WindowBase& w)
|
|||
* right (dx)
|
||||
* bottom (bp)
|
||||
*/
|
||||
void WindowDrawAll(DrawPixelInfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
void WindowDrawAll(DrawPixelInfo& dpi, int32_t left, int32_t top, int32_t right, int32_t bottom)
|
||||
{
|
||||
auto windowDPI = dpi->Crop({ left, top }, { right - left, bottom - top });
|
||||
auto windowDPI = dpi.Crop({ left, top }, { right - left, bottom - top });
|
||||
WindowVisitEach([&windowDPI, left, top, right, bottom](WindowBase* w) {
|
||||
if (w->flags & WF_TRANSPARENT)
|
||||
return;
|
||||
|
@ -2099,7 +2099,7 @@ void WindowDrawAll(DrawPixelInfo* dpi, int32_t left, int32_t top, int32_t right,
|
|||
return;
|
||||
if (left >= w->windowPos.x + w->width || top >= w->windowPos.y + w->height)
|
||||
return;
|
||||
WindowDraw(&windowDPI, *w, left, top, right, bottom);
|
||||
WindowDraw(windowDPI, *w, left, top, right, bottom);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -247,8 +247,8 @@ struct WindowEventList
|
|||
void (*cursor)(struct WindowBase*, WidgetIndex, const ScreenCoordsXY&, CursorID*){};
|
||||
void (*moved)(struct WindowBase*, const ScreenCoordsXY&){};
|
||||
void (*invalidate)(struct WindowBase*){};
|
||||
void (*paint)(struct WindowBase*, DrawPixelInfo*){};
|
||||
void (*scroll_paint)(struct WindowBase*, DrawPixelInfo*, int32_t){};
|
||||
void (*paint)(struct WindowBase*, DrawPixelInfo&){};
|
||||
void (*scroll_paint)(struct WindowBase*, DrawPixelInfo&, int32_t){};
|
||||
|
||||
typedef void (*fnEventInitializer)(WindowEventList&);
|
||||
WindowEventList(fnEventInitializer fn)
|
||||
|
@ -662,10 +662,10 @@ void WindowZoomIn(WindowBase& w, bool atCursor);
|
|||
void WindowZoomOut(WindowBase& w, bool atCursor);
|
||||
void MainWindowZoom(bool zoomIn, bool atCursor);
|
||||
|
||||
void WindowDrawAll(DrawPixelInfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
void WindowDraw(DrawPixelInfo* dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
void WindowDrawWidgets(WindowBase& w, DrawPixelInfo* dpi);
|
||||
void WindowDrawViewport(DrawPixelInfo* dpi, WindowBase& w);
|
||||
void WindowDrawAll(DrawPixelInfo& dpi, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
void WindowDraw(DrawPixelInfo& dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
void WindowDrawWidgets(WindowBase& w, DrawPixelInfo& dpi);
|
||||
void WindowDrawViewport(DrawPixelInfo& dpi, WindowBase& w);
|
||||
|
||||
void WindowSetPosition(WindowBase& w, const ScreenCoordsXY& screenCoords);
|
||||
void WindowMovePosition(WindowBase& w, const ScreenCoordsXY& screenCoords);
|
||||
|
@ -713,8 +713,8 @@ OpenRCT2String WindowEventTooltipCall(WindowBase* w, const WidgetIndex widgetInd
|
|||
CursorID WindowEventCursorCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
void WindowEventMovedCall(WindowBase* w, const ScreenCoordsXY& screenCoords);
|
||||
void WindowEventInvalidateCall(WindowBase* w);
|
||||
void WindowEventPaintCall(WindowBase* w, DrawPixelInfo* dpi);
|
||||
void WindowEventScrollPaintCall(WindowBase* w, DrawPixelInfo* dpi, int32_t scrollIndex);
|
||||
void WindowEventPaintCall(WindowBase* w, DrawPixelInfo& dpi);
|
||||
void WindowEventScrollPaintCall(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex);
|
||||
|
||||
void InvalidateAllWindowsAfterInput();
|
||||
void TextinputCancel();
|
||||
|
|
Loading…
Reference in New Issue