mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use dpi ref in rect and line drawing functions
This commit is contained in:
parent
2941f6f7a5
commit
bb83a80eab
|
@ -35,7 +35,7 @@ namespace Graph
|
|||
{ FontStyle::Small, TextAlignment::CENTRE });
|
||||
|
||||
// Draw month mark
|
||||
GfxFillRect(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10);
|
||||
GfxFillRect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10);
|
||||
}
|
||||
|
||||
yearOver32 = (yearOver32 + 1) % 32;
|
||||
|
@ -59,11 +59,11 @@ namespace Graph
|
|||
auto rightBottom1 = coords + ScreenCoordsXY{ 1, 1 };
|
||||
auto leftTop2 = lastCoords + ScreenCoordsXY{ 0, 1 };
|
||||
auto rightBottom2 = coords + ScreenCoordsXY{ 0, 1 };
|
||||
GfxDrawLine(&dpi, { leftTop1, rightBottom1 }, PALETTE_INDEX_10);
|
||||
GfxDrawLine(&dpi, { leftTop2, rightBottom2 }, PALETTE_INDEX_10);
|
||||
GfxDrawLine(dpi, { leftTop1, rightBottom1 }, PALETTE_INDEX_10);
|
||||
GfxDrawLine(dpi, { leftTop2, rightBottom2 }, PALETTE_INDEX_10);
|
||||
}
|
||||
if (i == 0)
|
||||
GfxFillRect(&dpi, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||
GfxFillRect(dpi, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||
|
||||
lastCoords = coords;
|
||||
}
|
||||
|
@ -85,10 +85,10 @@ namespace Graph
|
|||
{
|
||||
auto leftTop = lastCoords;
|
||||
auto rightBottom = coords;
|
||||
GfxDrawLine(&dpi, { leftTop, rightBottom }, PALETTE_INDEX_21);
|
||||
GfxDrawLine(dpi, { leftTop, rightBottom }, PALETTE_INDEX_21);
|
||||
}
|
||||
if (i == 0)
|
||||
GfxFillRect(&dpi, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PALETTE_INDEX_21);
|
||||
GfxFillRect(dpi, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PALETTE_INDEX_21);
|
||||
|
||||
lastCoords = coords;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ namespace Graph
|
|||
{ FontStyle::Small, TextAlignment::CENTRE });
|
||||
|
||||
// Draw month mark
|
||||
GfxFillRect(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10);
|
||||
GfxFillRect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10);
|
||||
}
|
||||
|
||||
yearOver32 = (yearOver32 + 1) % 32;
|
||||
|
@ -197,11 +197,11 @@ namespace Graph
|
|||
auto rightBottom1 = coords + ScreenCoordsXY{ 1, 1 };
|
||||
auto leftTop2 = lastCoords + ScreenCoordsXY{ 0, 1 };
|
||||
auto rightBottom2 = coords + ScreenCoordsXY{ 0, 1 };
|
||||
GfxDrawLine(&dpi, { leftTop1, rightBottom1 }, PALETTE_INDEX_10);
|
||||
GfxDrawLine(&dpi, { leftTop2, rightBottom2 }, PALETTE_INDEX_10);
|
||||
GfxDrawLine(dpi, { leftTop1, rightBottom1 }, PALETTE_INDEX_10);
|
||||
GfxDrawLine(dpi, { leftTop2, rightBottom2 }, PALETTE_INDEX_10);
|
||||
}
|
||||
if (i == 0)
|
||||
GfxFillRect(&dpi, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||
GfxFillRect(dpi, { coords, coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||
|
||||
lastCoords = coords;
|
||||
}
|
||||
|
@ -225,10 +225,10 @@ namespace Graph
|
|||
{
|
||||
auto leftTop = lastCoords;
|
||||
auto rightBottom = coords;
|
||||
GfxDrawLine(&dpi, { leftTop, rightBottom }, PALETTE_INDEX_21);
|
||||
GfxDrawLine(dpi, { leftTop, rightBottom }, PALETTE_INDEX_21);
|
||||
}
|
||||
if (i == 0)
|
||||
GfxFillRect(&dpi, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PALETTE_INDEX_21);
|
||||
GfxFillRect(dpi, { coords - ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 1, 1 } }, PALETTE_INDEX_21);
|
||||
|
||||
lastCoords = coords;
|
||||
}
|
||||
|
@ -254,12 +254,12 @@ namespace Graph
|
|||
{
|
||||
return;
|
||||
}
|
||||
GfxDrawDashedLine(&dpi, { { info.coords.x, chartFrame.GetTop() }, info.coords }, DefaultDashedLength, 0);
|
||||
GfxDrawDashedLine(&dpi, { { chartFrame.GetLeft() - 10, info.coords.y }, info.coords }, DefaultDashedLength, 0);
|
||||
GfxDrawDashedLine(dpi, { { info.coords.x, chartFrame.GetTop() }, info.coords }, DefaultDashedLength, 0);
|
||||
GfxDrawDashedLine(dpi, { { chartFrame.GetLeft() - 10, info.coords.y }, info.coords }, DefaultDashedLength, 0);
|
||||
|
||||
if (cursorPosition.y > info.coords.y)
|
||||
{
|
||||
GfxDrawDashedLine(&dpi, { info.coords, { info.coords.x, cursorPosition.y } }, DefaultDashedLength, 0);
|
||||
GfxDrawDashedLine(dpi, { info.coords, { info.coords.x, cursorPosition.y } }, DefaultDashedLength, 0);
|
||||
}
|
||||
|
||||
auto ft = Formatter();
|
||||
|
@ -267,9 +267,9 @@ namespace Graph
|
|||
DrawTextBasic(
|
||||
dpi, info.coords - ScreenCoordsXY{ 0, 16 }, STR_FINANCES_SUMMARY_EXPENDITURE_VALUE, ft, { TextAlignment::CENTRE });
|
||||
|
||||
GfxFillRect(&dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||
GfxFillRect(dpi, { { info.coords - ScreenCoordsXY{ 2, 2 } }, info.coords + ScreenCoordsXY{ 2, 2 } }, PALETTE_INDEX_10);
|
||||
GfxFillRect(
|
||||
&dpi, { { info.coords - ScreenCoordsXY{ 1, 1 } }, { info.coords + ScreenCoordsXY{ 1, 1 } } }, PALETTE_INDEX_21);
|
||||
dpi, { { info.coords - ScreenCoordsXY{ 1, 1 } }, { info.coords + ScreenCoordsXY{ 1, 1 } } }, PALETTE_INDEX_21);
|
||||
}
|
||||
|
||||
void Draw(
|
||||
|
|
|
@ -292,18 +292,18 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const
|
|||
Invalidate();
|
||||
|
||||
// Give console area a translucent effect.
|
||||
GfxFilterRect(&dpi, { _consoleTopLeft, _consoleBottomRight }, FilterPaletteID::Palette51);
|
||||
GfxFilterRect(dpi, { _consoleTopLeft, _consoleBottomRight }, FilterPaletteID::Palette51);
|
||||
|
||||
// Make input area more opaque.
|
||||
GfxFilterRect(
|
||||
&dpi, { { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 }, _consoleBottomRight - ScreenCoordsXY{ 0, 1 } },
|
||||
dpi, { { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 }, _consoleBottomRight - ScreenCoordsXY{ 0, 1 } },
|
||||
FilterPaletteID::Palette51);
|
||||
|
||||
// Paint background colour.
|
||||
uint8_t backgroundColour = ThemeGetColour(WindowClass::Console, 0);
|
||||
GfxFillRectInset(&dpi, { _consoleTopLeft, _consoleBottomRight }, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
|
||||
GfxFillRectInset(dpi, { _consoleTopLeft, _consoleBottomRight }, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
|
||||
GfxFillRectInset(
|
||||
&dpi, { _consoleTopLeft + ScreenCoordsXY{ 1, 1 }, _consoleBottomRight - ScreenCoordsXY{ 1, 1 } }, backgroundColour,
|
||||
dpi, { _consoleTopLeft + ScreenCoordsXY{ 1, 1 }, _consoleBottomRight - ScreenCoordsXY{ 1, 1 } }, backgroundColour,
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
std::string lineBuffer;
|
||||
|
@ -329,7 +329,7 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const
|
|||
{
|
||||
auto caret = screenCoords + ScreenCoordsXY{ _caretScreenPosX, lineHeight };
|
||||
uint8_t caretColour = ColourMapA[BASE_COLOUR(textColour)].lightest;
|
||||
GfxFillRect(&dpi, { caret, caret + ScreenCoordsXY{ CONSOLE_CARET_WIDTH, 1 } }, caretColour);
|
||||
GfxFillRect(dpi, { caret, caret + ScreenCoordsXY{ CONSOLE_CARET_WIDTH, 1 } }, caretColour);
|
||||
}
|
||||
|
||||
// What about border colours?
|
||||
|
@ -338,21 +338,21 @@ void InGameConsole::Draw(DrawPixelInfo& dpi) const
|
|||
|
||||
// Input area top border
|
||||
GfxFillRect(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 11 },
|
||||
{ _consoleBottomRight.x, _consoleBottomRight.y - lineHeight - 11 } },
|
||||
borderColour1);
|
||||
GfxFillRect(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ { _consoleTopLeft.x, _consoleBottomRight.y - lineHeight - 10 },
|
||||
{ _consoleBottomRight.x, _consoleBottomRight.y - lineHeight - 10 } },
|
||||
borderColour2);
|
||||
|
||||
// Input area bottom border
|
||||
GfxFillRect(
|
||||
&dpi, { { _consoleTopLeft.x, _consoleBottomRight.y - 1 }, { _consoleBottomRight.x, _consoleBottomRight.y - 1 } },
|
||||
dpi, { { _consoleTopLeft.x, _consoleBottomRight.y - 1 }, { _consoleBottomRight.x, _consoleBottomRight.y - 1 } },
|
||||
borderColour1);
|
||||
GfxFillRect(&dpi, { { _consoleTopLeft.x, _consoleBottomRight.y }, _consoleBottomRight }, borderColour2);
|
||||
GfxFillRect(dpi, { { _consoleTopLeft.x, _consoleBottomRight.y }, _consoleBottomRight }, borderColour2);
|
||||
}
|
||||
|
||||
// Calculates the amount of visible lines, based on the console size, excluding the input line.
|
||||
|
|
|
@ -134,7 +134,7 @@ static void WidgetFrameDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widge
|
|||
uint8_t colour = w.colours[widget.colour];
|
||||
|
||||
// Draw the frame
|
||||
GfxFillRectInset(&dpi, { leftTop, { r, b } }, colour, press);
|
||||
GfxFillRectInset(dpi, { leftTop, { r, b } }, colour, press);
|
||||
|
||||
// Check if the window can be resized
|
||||
if (!(w.flags & WF_RESIZABLE))
|
||||
|
@ -165,7 +165,7 @@ static void WidgetResizeDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widg
|
|||
uint8_t colour = w.colours[widget.colour];
|
||||
|
||||
// Draw the panel
|
||||
GfxFillRectInset(&dpi, { leftTop, { r, b } }, colour, 0);
|
||||
GfxFillRectInset(dpi, { leftTop, { r, b } }, colour, 0);
|
||||
|
||||
// Check if the window can be resized
|
||||
if (!(w.flags & WF_RESIZABLE))
|
||||
|
@ -200,12 +200,12 @@ static void WidgetButtonDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widg
|
|||
if (static_cast<int32_t>(widget.image.ToUInt32()) == -2)
|
||||
{
|
||||
// Draw border with no fill
|
||||
GfxFillRectInset(&dpi, rect, colour, press | INSET_RECT_FLAG_FILL_NONE);
|
||||
GfxFillRectInset(dpi, rect, colour, press | INSET_RECT_FLAG_FILL_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw the border with fill
|
||||
GfxFillRectInset(&dpi, rect, colour, press);
|
||||
GfxFillRectInset(dpi, rect, colour, press);
|
||||
|
||||
WidgetDrawImage(dpi, w, widgetIndex);
|
||||
}
|
||||
|
@ -287,12 +287,12 @@ static void WidgetFlatButtonDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex
|
|||
if (static_cast<int32_t>(widget.image.ToUInt32()) == -2)
|
||||
{
|
||||
// Draw border with no fill
|
||||
GfxFillRectInset(&dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE);
|
||||
GfxFillRectInset(dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw the border with fill
|
||||
GfxFillRectInset(&dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET);
|
||||
GfxFillRectInset(dpi, rect, colour, INSET_RECT_FLAG_BORDER_INSET);
|
||||
}
|
||||
|
||||
// Draw image
|
||||
|
@ -317,7 +317,7 @@ static void WidgetTextButton(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widg
|
|||
|
||||
// Border
|
||||
uint8_t press = WidgetIsPressed(w, widgetIndex) || WidgetIsActiveTool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||
GfxFillRectInset(&dpi, rect, colour, press);
|
||||
GfxFillRectInset(dpi, rect, colour, press);
|
||||
|
||||
// Button caption
|
||||
if (widget.type != WindowWidgetType::TableHeader)
|
||||
|
@ -441,7 +441,7 @@ static void WidgetTextInset(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widge
|
|||
// Get the colour
|
||||
uint8_t colour = w.colours[widget.colour];
|
||||
|
||||
GfxFillRectInset(&dpi, rect, colour, INSET_RECT_F_60);
|
||||
GfxFillRectInset(dpi, rect, colour, INSET_RECT_F_60);
|
||||
WidgetText(dpi, w, widgetIndex);
|
||||
}
|
||||
|
||||
|
@ -506,24 +506,24 @@ static void WidgetGroupboxDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex wi
|
|||
uint8_t colour = w.colours[widget.colour] & 0x7F;
|
||||
|
||||
// Border left of text
|
||||
GfxFillRect(&dpi, { { l, t }, { l + 4, t } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l + 1, t + 1 }, { l + 4, t + 1 } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l, t }, { l + 4, t } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l + 1, t + 1 }, { l + 4, t + 1 } }, ColourMapA[colour].lighter);
|
||||
|
||||
// Border right of text
|
||||
GfxFillRect(&dpi, { { textRight, t }, { r - 1, t } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { textRight, t + 1 }, { r - 2, t + 1 } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { textRight, t }, { r - 1, t } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { textRight, t + 1 }, { r - 2, t + 1 } }, ColourMapA[colour].lighter);
|
||||
|
||||
// Border right
|
||||
GfxFillRect(&dpi, { { r - 1, t + 1 }, { r - 1, b - 1 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { r, t }, { r, b } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { r - 1, t + 1 }, { r - 1, b - 1 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { r, t }, { r, b } }, ColourMapA[colour].lighter);
|
||||
|
||||
// Border bottom
|
||||
GfxFillRect(&dpi, { { l, b - 1 }, { r - 2, b - 1 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l, b }, { r - 1, b } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l, b - 1 }, { r - 2, b - 1 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l, b }, { r - 1, b } }, ColourMapA[colour].lighter);
|
||||
|
||||
// Border left
|
||||
GfxFillRect(&dpi, { { l, t + 1 }, { l, b - 2 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l + 1, t + 2 }, { l + 1, b - 2 } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l, t + 1 }, { l, b - 2 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l + 1, t + 2 }, { l + 1, b - 2 } }, ColourMapA[colour].lighter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -546,15 +546,15 @@ static void WidgetCaptionDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex wid
|
|||
if (w.flags & WF_10)
|
||||
press |= INSET_RECT_FLAG_FILL_MID_LIGHT;
|
||||
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colour, press);
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, press);
|
||||
|
||||
// Black caption bars look slightly green, this fixes that
|
||||
if (colour == 0)
|
||||
GfxFillRect(
|
||||
&dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } }, ColourMapA[colour].dark);
|
||||
dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } }, ColourMapA[colour].dark);
|
||||
else
|
||||
GfxFilterRect(
|
||||
&dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } },
|
||||
dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
|
||||
// Draw text
|
||||
|
@ -599,7 +599,7 @@ static void WidgetCloseboxDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex wi
|
|||
uint8_t colour = w.colours[widget.colour];
|
||||
|
||||
// Draw the button
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colour, press);
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, press);
|
||||
|
||||
if (widget.text == STR_NONE)
|
||||
return;
|
||||
|
@ -630,7 +630,7 @@ static void WidgetCheckboxDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex wi
|
|||
colour_t colour = w.colours[widget.colour];
|
||||
|
||||
// checkbox
|
||||
GfxFillRectInset(&dpi, { midLeft - ScreenCoordsXY{ 0, 5 }, midLeft + ScreenCoordsXY{ 9, 4 } }, colour, INSET_RECT_F_60);
|
||||
GfxFillRectInset(dpi, { midLeft - ScreenCoordsXY{ 0, 5 }, midLeft + ScreenCoordsXY{ 9, 4 } }, colour, INSET_RECT_F_60);
|
||||
|
||||
if (WidgetIsDisabled(w, widgetIndex))
|
||||
{
|
||||
|
@ -672,7 +672,7 @@ static void WidgetScrollDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widg
|
|||
uint8_t colour = w.colours[widget.colour];
|
||||
|
||||
// Draw the border
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60);
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60);
|
||||
|
||||
// Inflate by -1
|
||||
topLeft.x++;
|
||||
|
@ -730,18 +730,18 @@ static void WidgetHScrollbarDraw(
|
|||
{
|
||||
colour &= 0x7F;
|
||||
// Trough
|
||||
GfxFillRect(&dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(&dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, 0x1000000 | ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l + SCROLLBAR_WIDTH, t + 2 }, { r - SCROLLBAR_WIDTH, t + 2 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l + SCROLLBAR_WIDTH, t + 3 }, { r - SCROLLBAR_WIDTH, t + 3 } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(&dpi, { { l + SCROLLBAR_WIDTH, t + 7 }, { r - SCROLLBAR_WIDTH, t + 7 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l + SCROLLBAR_WIDTH, t + 8 }, { r - SCROLLBAR_WIDTH, t + 8 } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, 0x1000000 | ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 2 }, { r - SCROLLBAR_WIDTH, t + 2 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 3 }, { r - SCROLLBAR_WIDTH, t + 3 } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 7 }, { r - SCROLLBAR_WIDTH, t + 7 } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 8 }, { r - SCROLLBAR_WIDTH, t + 8 } }, ColourMapA[colour].lighter);
|
||||
|
||||
// Left button
|
||||
{
|
||||
uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||
|
||||
GfxFillRectInset(&dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags);
|
||||
GfxFillRectInset(dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags);
|
||||
GfxDrawString(dpi, { l + 1, t }, static_cast<const char*>(BlackLeftArrowString), {});
|
||||
}
|
||||
|
||||
|
@ -751,14 +751,14 @@ static void WidgetHScrollbarDraw(
|
|||
int16_t right = std::min(r - SCROLLBAR_WIDTH, l + scroll.h_thumb_right - 1);
|
||||
uint8_t flags = (scroll.flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||
|
||||
GfxFillRectInset(&dpi, { { left, t }, { right, b } }, colour, flags);
|
||||
GfxFillRectInset(dpi, { { left, t }, { right, b } }, colour, flags);
|
||||
}
|
||||
|
||||
// Right button
|
||||
{
|
||||
uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
|
||||
|
||||
GfxFillRectInset(&dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags);
|
||||
GfxFillRectInset(dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags);
|
||||
GfxDrawString(dpi, { r - 6, t }, static_cast<const char*>(BlackRightArrowString), {});
|
||||
}
|
||||
}
|
||||
|
@ -768,29 +768,29 @@ static void WidgetVScrollbarDraw(
|
|||
{
|
||||
colour &= 0x7F;
|
||||
// Trough
|
||||
GfxFillRect(&dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(&dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, 0x1000000 | ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l + 2, t + SCROLLBAR_WIDTH }, { l + 2, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l + 3, t + SCROLLBAR_WIDTH }, { l + 3, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(&dpi, { { l + 7, t + SCROLLBAR_WIDTH }, { l + 7, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(&dpi, { { l + 8, t + SCROLLBAR_WIDTH }, { l + 8, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, 0x1000000 | ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l + 2, t + SCROLLBAR_WIDTH }, { l + 2, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l + 3, t + SCROLLBAR_WIDTH }, { l + 3, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||
GfxFillRect(dpi, { { l + 7, t + SCROLLBAR_WIDTH }, { l + 7, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark);
|
||||
GfxFillRect(dpi, { { l + 8, t + SCROLLBAR_WIDTH }, { l + 8, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter);
|
||||
|
||||
// Up button
|
||||
GfxFillRectInset(
|
||||
&dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour,
|
||||
dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour,
|
||||
((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
||||
GfxDrawString(dpi, { l + 1, t - 1 }, static_cast<const char*>(BlackUpArrowString), {});
|
||||
|
||||
// Thumb
|
||||
GfxFillRectInset(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ { l, std::max(t + SCROLLBAR_WIDTH, t + scroll.v_thumb_top - 1) },
|
||||
{ r, std::min(b - SCROLLBAR_WIDTH, t + scroll.v_thumb_bottom - 1) } },
|
||||
colour, ((scroll.flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
||||
|
||||
// Down button
|
||||
GfxFillRectInset(
|
||||
&dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour,
|
||||
dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour,
|
||||
((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
|
||||
GfxDrawString(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast<const char*>(BlackDownArrowString), {});
|
||||
}
|
||||
|
@ -1136,8 +1136,8 @@ static void WidgetTextBoxDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex wid
|
|||
bool active = w.classification == gCurrentTextBox.window.classification && w.number == gCurrentTextBox.window.number
|
||||
&& widgetIndex == gCurrentTextBox.widget_index;
|
||||
|
||||
// GfxFillRectInset(&dpi, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00));
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60);
|
||||
// GfxFillRectInset(dpi, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00));
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, colour, INSET_RECT_F_60);
|
||||
|
||||
// Figure out where the text should be positioned vertically.
|
||||
topLeft.y = w.windowPos.y + widget.textTop();
|
||||
|
@ -1180,7 +1180,7 @@ static void WidgetTextBoxDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex wid
|
|||
{
|
||||
colour = ColourMapA[w.colours[1]].mid_light;
|
||||
auto y = topLeft.y + (widget.height() - 1);
|
||||
GfxFillRect(&dpi, { { curX, y }, { curX + width, y } }, colour + 5);
|
||||
GfxFillRect(dpi, { { curX, y }, { curX + width, y } }, colour + 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -636,7 +636,7 @@ void WindowDrawWidgets(WindowBase& w, DrawPixelInfo& dpi)
|
|||
|
||||
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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -552,7 +552,7 @@ void CustomListView::MouseUp(const ScreenCoordsXY& pos)
|
|||
void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* scroll) const
|
||||
{
|
||||
auto paletteIndex = ColourMapA[w->colours[1]].mid_light;
|
||||
GfxFillRect(&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, paletteIndex);
|
||||
GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, paletteIndex);
|
||||
|
||||
int32_t y = ShowColumnHeaders ? COLUMN_HEADER_HEIGHT : 0;
|
||||
for (size_t i = 0; i < Items.size(); i++)
|
||||
|
@ -583,19 +583,19 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s
|
|||
if (isSelected)
|
||||
{
|
||||
GfxFilterRect(
|
||||
&dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||
dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||
FilterPaletteID::PaletteDarken2);
|
||||
}
|
||||
else if (isHighlighted)
|
||||
{
|
||||
GfxFilterRect(
|
||||
&dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||
dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||
FilterPaletteID::PaletteDarken2);
|
||||
}
|
||||
else if (isStriped)
|
||||
{
|
||||
GfxFillRect(
|
||||
&dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||
dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + (LIST_ROW_HEIGHT - 1) } },
|
||||
ColourMapA[w->colours[1]].lighter | 0x1000000);
|
||||
}
|
||||
|
||||
|
@ -641,7 +641,7 @@ void CustomListView::Paint(WindowBase* w, DrawPixelInfo& dpi, const ScrollBar* s
|
|||
y = scroll->v_top;
|
||||
|
||||
auto bgColour = ColourMapA[w->colours[1]].mid_light;
|
||||
GfxFillRect(&dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + 12 } }, bgColour);
|
||||
GfxFillRect(dpi, { { dpi.x, y }, { dpi.x + dpi.width, y + 12 } }, bgColour);
|
||||
|
||||
int32_t x = 0;
|
||||
for (int32_t j = 0; j < static_cast<int32_t>(Columns.size()); j++)
|
||||
|
@ -673,7 +673,7 @@ void CustomListView::PaintHeading(
|
|||
{
|
||||
boxFlags = INSET_RECT_FLAG_BORDER_INSET;
|
||||
}
|
||||
GfxFillRectInset(&dpi, { pos, pos + ScreenCoordsXY{ size.width - 1, size.height - 1 } }, w->colours[1], boxFlags);
|
||||
GfxFillRectInset(dpi, { pos, pos + ScreenCoordsXY{ size.width - 1, size.height - 1 } }, w->colours[1], boxFlags);
|
||||
if (!text.empty())
|
||||
{
|
||||
PaintCell(dpi, pos, size, text.c_str(), false);
|
||||
|
@ -723,32 +723,32 @@ void CustomListView::PaintSeperator(
|
|||
// Draw light horizontal rule
|
||||
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY0 };
|
||||
auto lightLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY0 };
|
||||
GfxDrawLine(&dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||
GfxDrawLine(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||
|
||||
auto lightLineLeftTop2 = ScreenCoordsXY{ strRight, lineY0 };
|
||||
auto lightLineRightBottom2 = ScreenCoordsXY{ right, lineY0 };
|
||||
GfxDrawLine(&dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour);
|
||||
GfxDrawLine(dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour);
|
||||
|
||||
// Draw dark horizontal rule
|
||||
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY1 };
|
||||
auto darkLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY1 };
|
||||
GfxDrawLine(&dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||
GfxDrawLine(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||
|
||||
auto darkLineLeftTop2 = ScreenCoordsXY{ strRight, lineY1 };
|
||||
auto darkLineRightBottom2 = ScreenCoordsXY{ right, lineY1 };
|
||||
GfxDrawLine(&dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour);
|
||||
GfxDrawLine(dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw light horizontal rule
|
||||
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY0 };
|
||||
auto lightLineRightBottom1 = ScreenCoordsXY{ right, lineY0 };
|
||||
GfxDrawLine(&dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||
GfxDrawLine(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||
|
||||
// Draw dark horizontal rule
|
||||
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY1 };
|
||||
auto darkLineRightBottom1 = ScreenCoordsXY{ right, lineY1 };
|
||||
GfxDrawLine(&dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||
GfxDrawLine(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -163,13 +163,13 @@ namespace OpenRCT2::Scripting
|
|||
|
||||
void box(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
GfxFillRectInset(&_dpi, { x, y, x + width - 1, y + height - 1 }, _colour.value_or(0), 0);
|
||||
GfxFillRectInset(_dpi, { x, y, x + width - 1, y + height - 1 }, _colour.value_or(0), 0);
|
||||
}
|
||||
|
||||
void well(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
{
|
||||
GfxFillRectInset(
|
||||
&_dpi, { x, y, x + width - 1, y + height - 1 }, _colour.value_or(0),
|
||||
_dpi, { x, y, x + width - 1, y + height - 1 }, _colour.value_or(0),
|
||||
INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_DONT_LIGHTEN);
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ namespace OpenRCT2::Scripting
|
|||
|
||||
void line(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
|
||||
{
|
||||
GfxDrawLine(&_dpi, { { x1, y1 }, { x2, y2 } }, _stroke);
|
||||
GfxDrawLine(_dpi, { { x1, y1 }, { x2, y2 } }, _stroke);
|
||||
}
|
||||
|
||||
void rect(int32_t x, int32_t y, int32_t width, int32_t height)
|
||||
|
@ -229,7 +229,7 @@ namespace OpenRCT2::Scripting
|
|||
}
|
||||
if (_fill != 0)
|
||||
{
|
||||
GfxFillRect(&_dpi, { x, y, x + width - 1, y + height - 1 }, _fill);
|
||||
GfxFillRect(_dpi, { x, y, x + width - 1, y + height - 1 }, _fill);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ public:
|
|||
{
|
||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||
GfxFillRect(
|
||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
|
||||
auto assetPackManager = GetContext()->GetAssetPackManager();
|
||||
if (assetPackManager == nullptr)
|
||||
|
@ -240,12 +240,12 @@ private:
|
|||
auto fillRectangle = ScreenRect{ { 0, y }, { listWidth, y + ItemHeight - 1 } };
|
||||
if (isSelected)
|
||||
{
|
||||
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||
GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
}
|
||||
else if (isHighlighted)
|
||||
{
|
||||
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||
GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||
}
|
||||
|
||||
DrawTextEllipsised(dpi, { 16, y + 1 }, listWidth, stringId, ft);
|
||||
|
@ -256,7 +256,7 @@ private:
|
|||
|
||||
void PaintCheckbox(DrawPixelInfo& dpi, const ScreenRect& rect, bool checked)
|
||||
{
|
||||
GfxFillRectInset(&dpi, rect, colours[1], INSET_RECT_F_E0);
|
||||
GfxFillRectInset(dpi, rect, colours[1], INSET_RECT_F_E0);
|
||||
if (checked)
|
||||
{
|
||||
auto checkmark = Formatter();
|
||||
|
|
|
@ -161,13 +161,13 @@ public:
|
|||
if (colours[0] & COLOUR_FLAG_TRANSLUCENT)
|
||||
{
|
||||
TranslucentWindowPalette palette = TranslucentWindowPalettes[BASE_COLOUR(colours[0])];
|
||||
GfxFilterRect(&dpi, { leftTop, rightBottom }, palette.highlight);
|
||||
GfxFilterRect(&dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow);
|
||||
GfxFilterRect(dpi, { leftTop, rightBottom }, palette.highlight);
|
||||
GfxFilterRect(dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow);
|
||||
}
|
||||
else
|
||||
{
|
||||
GfxFillRect(&dpi, { leftTop, rightBottom }, ColourMapA[colours[0]].mid_dark);
|
||||
GfxFillRect(&dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[colours[0]].lightest);
|
||||
GfxFillRect(dpi, { leftTop, rightBottom }, ColourMapA[colours[0]].mid_dark);
|
||||
GfxFillRect(dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[colours[0]].lightest);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -176,7 +176,7 @@ public:
|
|||
{
|
||||
// Darken the cell's background slightly when highlighted
|
||||
const ScreenCoordsXY rightBottom = screenCoords + ScreenCoordsXY{ ItemWidth - 1, ItemHeight - 1 };
|
||||
GfxFilterRect(&dpi, { screenCoords, rightBottom }, FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(dpi, { screenCoords, rightBottom }, FilterPaletteID::PaletteDarken3);
|
||||
}
|
||||
|
||||
StringId item = gDropdownItems[i].Format;
|
||||
|
|
|
@ -283,7 +283,7 @@ private:
|
|||
auto previousWidget = widgets[WIDX_PREVIOUS_IMAGE];
|
||||
auto leftTop = windowPos + ScreenCoordsXY{ previousWidget.left, previousWidget.top };
|
||||
auto rightBottom = windowPos + ScreenCoordsXY{ previousWidget.right, previousWidget.bottom };
|
||||
GfxFilterRect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
}
|
||||
|
||||
void DrawLeftButton(DrawPixelInfo& dpi)
|
||||
|
@ -292,7 +292,7 @@ private:
|
|||
+ ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 1, widgets[WIDX_PREVIOUS_IMAGE].top + 1 };
|
||||
const auto bottomRight = windowPos
|
||||
+ ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].right - 1, widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 };
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
|
||||
|
||||
GfxDrawSprite(
|
||||
dpi, ImageId(SPR_PREVIOUS),
|
||||
|
@ -321,7 +321,7 @@ private:
|
|||
auto nextWidget = widgets[WIDX_NEXT_IMAGE];
|
||||
auto leftTop = windowPos + ScreenCoordsXY{ nextWidget.left, nextWidget.top };
|
||||
auto rightBottom = windowPos + ScreenCoordsXY{ nextWidget.right, nextWidget.bottom };
|
||||
GfxFilterRect(&dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51);
|
||||
}
|
||||
|
||||
void DrawRightButton(DrawPixelInfo& dpi)
|
||||
|
@ -329,7 +329,7 @@ private:
|
|||
const auto topLeft = windowPos + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].left + 1, widgets[WIDX_NEXT_IMAGE].top + 1 };
|
||||
const auto bottomRight = windowPos
|
||||
+ ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 1, widgets[WIDX_NEXT_IMAGE].bottom - 1 };
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
|
||||
|
||||
GfxDrawSprite(
|
||||
dpi, ImageId(SPR_NEXT),
|
||||
|
|
|
@ -296,7 +296,7 @@ public:
|
|||
bottom = itemY;
|
||||
}
|
||||
|
||||
GfxFilterRect(&dpi, { 0, top, boxWidth, bottom }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, top, boxWidth, bottom }, FilterPaletteID::PaletteDarken1);
|
||||
}
|
||||
|
||||
if (dragItem != nullptr && researchItem == *dragItem)
|
||||
|
@ -367,7 +367,7 @@ public:
|
|||
// Preview background
|
||||
auto& bkWidget = widgets[WIDX_PREVIEW];
|
||||
GfxFillRect(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 },
|
||||
windowPos + ScreenCoordsXY{ bkWidget.right - 1, bkWidget.bottom - 1 } },
|
||||
ColourMapA[colours[1]].darkest);
|
||||
|
|
|
@ -707,7 +707,7 @@ public:
|
|||
{
|
||||
// Draw checkbox
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && !(*listItem.flags & 0x20))
|
||||
GfxFillRectInset(&dpi, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], INSET_RECT_F_E0);
|
||||
GfxFillRectInset(dpi, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], INSET_RECT_F_E0);
|
||||
|
||||
// Highlight background
|
||||
auto highlighted = i == static_cast<size_t>(selected_list_item)
|
||||
|
@ -715,7 +715,7 @@ public:
|
|||
if (highlighted)
|
||||
{
|
||||
auto bottom = screenCoords.y + (SCROLLABLE_ROW_HEIGHT - 1);
|
||||
GfxFilterRect(&dpi, { 0, screenCoords.y, width, bottom }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, screenCoords.y, width, bottom }, FilterPaletteID::PaletteDarken1);
|
||||
}
|
||||
|
||||
// Draw checkmark
|
||||
|
@ -1005,7 +1005,7 @@ public:
|
|||
// Preview background
|
||||
const auto& previewWidget = widgets[WIDX_PREVIEW];
|
||||
GfxFillRect(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 },
|
||||
windowPos + ScreenCoordsXY{ previewWidget.right - 1, previewWidget.bottom - 1 } },
|
||||
ColourMapA[colours[1]].darkest);
|
||||
|
|
|
@ -1110,7 +1110,7 @@ private:
|
|||
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++)
|
||||
{
|
||||
|
@ -1120,14 +1120,14 @@ private:
|
|||
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
|
||||
|
|
|
@ -63,34 +63,34 @@ public:
|
|||
ScreenCoordsXY rightTop{ rightBottom.x, leftTop.y };
|
||||
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
|
||||
dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
|
||||
FilterPaletteID::Palette45);
|
||||
GfxFilterRect(&dpi, ScreenRect{ leftTop, rightBottom }, FilterPaletteID::PaletteGlassSaturatedRed);
|
||||
GfxFilterRect(dpi, ScreenRect{ leftTop, rightBottom }, FilterPaletteID::PaletteGlassSaturatedRed);
|
||||
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 0, 2 }, leftBottom - ScreenCoordsXY{ 0, 2 } },
|
||||
dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 0, 2 }, leftBottom - ScreenCoordsXY{ 0, 2 } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 0, 2 }, rightBottom - ScreenCoordsXY{ 0, 2 } },
|
||||
dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 0, 2 }, rightBottom - ScreenCoordsXY{ 0, 2 } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 2, 0 }, rightBottom - ScreenCoordsXY{ 2, 0 } },
|
||||
dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 2, 0 }, rightBottom - ScreenCoordsXY{ 2, 0 } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 2, 0 }, rightTop - ScreenCoordsXY{ 2, 0 } },
|
||||
dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 2, 0 }, rightTop - ScreenCoordsXY{ 2, 0 } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 1, 1 }, rightTop + ScreenCoordsXY{ 1, 1 } },
|
||||
dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 1, 1 }, rightTop + ScreenCoordsXY{ 1, 1 } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ rightTop + ScreenCoordsXY{ -1, 1 }, rightTop + ScreenCoordsXY{ -1, 1 } },
|
||||
dpi, ScreenRect{ rightTop + ScreenCoordsXY{ -1, 1 }, rightTop + ScreenCoordsXY{ -1, 1 } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 1, -1 }, leftBottom + ScreenCoordsXY{ 1, -1 } },
|
||||
dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 1, -1 }, leftBottom + ScreenCoordsXY{ 1, -1 } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(
|
||||
&dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
|
||||
dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
|
||||
FilterPaletteID::PaletteDarken3);
|
||||
|
||||
DrawStringCentredRaw(
|
||||
|
|
|
@ -372,7 +372,7 @@ public:
|
|||
// Darken every even row
|
||||
if (i % 2 == 0)
|
||||
GfxFillRect(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ screenCoords - ScreenCoordsXY{ 0, 1 },
|
||||
screenCoords + ScreenCoordsXY{ row_width, (TABLE_CELL_HEIGHT - 2) } },
|
||||
ColourMapA[colours[1]].lighter | 0x1000000);
|
||||
|
@ -426,8 +426,7 @@ public:
|
|||
dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT });
|
||||
|
||||
GfxFillRect(
|
||||
&dpi,
|
||||
{ screenCoords + ScreenCoordsXY{ 10, -2 }, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, -2 } },
|
||||
dpi, { screenCoords + ScreenCoordsXY{ 10, -2 }, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, -2 } },
|
||||
PALETTE_INDEX_10);
|
||||
|
||||
screenCoords.x += EXPENDITURE_COLUMN_WIDTH;
|
||||
|
@ -542,7 +541,7 @@ public:
|
|||
// Darken every even row
|
||||
if (i % 2 == 0)
|
||||
GfxFillRect(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (TABLE_CELL_HEIGHT - 2) } },
|
||||
ColourMapA[colours[1]].lighter | 0x1000000);
|
||||
|
||||
|
@ -552,7 +551,7 @@ public:
|
|||
|
||||
// Horizontal rule below expenditure / income table
|
||||
GfxFillRectInset(
|
||||
&dpi, { windowPos + ScreenCoordsXY{ 8, 272 }, windowPos + ScreenCoordsXY{ 8 + 513, 272 + 1 } }, colours[1],
|
||||
dpi, { windowPos + ScreenCoordsXY{ 8, 272 }, windowPos + ScreenCoordsXY{ 8 + 513, 272 + 1 } }, colours[1],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
// Loan and interest rate
|
||||
|
@ -618,7 +617,7 @@ public:
|
|||
ft);
|
||||
|
||||
// Graph
|
||||
GfxFillRectInset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||
int32_t yAxisScale = 0;
|
||||
|
@ -649,7 +648,7 @@ public:
|
|||
dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
||||
{ FontStyle::Small, TextAlignment::RIGHT });
|
||||
GfxFillRectInset(
|
||||
&dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
|
||||
dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
coords.y += 39;
|
||||
}
|
||||
|
@ -675,7 +674,7 @@ public:
|
|||
DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft);
|
||||
|
||||
// Graph
|
||||
GfxFillRectInset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||
int32_t yAxisScale = 0;
|
||||
|
@ -706,7 +705,7 @@ public:
|
|||
dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
||||
{ FontStyle::Small, TextAlignment::RIGHT });
|
||||
GfxFillRectInset(
|
||||
&dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
|
||||
dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
coords.y += 39;
|
||||
}
|
||||
|
@ -734,7 +733,7 @@ public:
|
|||
gCurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft);
|
||||
|
||||
// Graph
|
||||
GfxFillRectInset(&dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||
GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30);
|
||||
|
||||
// Calculate the Y axis scale (log2 of highest [+/-]balance)
|
||||
int32_t yAxisScale = 0;
|
||||
|
@ -765,7 +764,7 @@ public:
|
|||
dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft,
|
||||
{ FontStyle::Small, TextAlignment::RIGHT });
|
||||
GfxFillRectInset(
|
||||
&dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2],
|
||||
dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
screenPos.y += 39;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -456,12 +456,12 @@ static void WindowGameBottomToolbarDrawParkRating(
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -649,7 +649,7 @@ static void WindowGameBottomToolbarDrawMiddlePanel(DrawPixelInfo& dpi, WindowBas
|
|||
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);
|
||||
|
|
|
@ -1041,7 +1041,7 @@ private:
|
|||
}
|
||||
|
||||
GfxFillRectInset(
|
||||
&dpi, { coords + ScreenCoordsXY{ 61, 1 }, coords + ScreenCoordsXY{ 61 + 121, 9 } }, colours[1], INSET_RECT_F_30);
|
||||
dpi, { coords + ScreenCoordsXY{ 61, 1 }, coords + ScreenCoordsXY{ 61 + 121, 9 } }, colours[1], INSET_RECT_F_30);
|
||||
|
||||
if (!blinkFlag || GameIsPaused() || (gCurrentRealTimeTicks & 8) == 0)
|
||||
{
|
||||
|
@ -1052,7 +1052,7 @@ private:
|
|||
return;
|
||||
|
||||
GfxFillRectInset(
|
||||
&dpi, { coords + ScreenCoordsXY{ 63, 2 }, coords + ScreenCoordsXY{ 63 + value - 1, 8 } }, colour, 0);
|
||||
dpi, { coords + ScreenCoordsXY{ 63, 2 }, coords + ScreenCoordsXY{ 63 + value - 1, 8 } }, colour, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1157,7 +1157,7 @@ private:
|
|||
|
||||
screenCoords.y += LIST_ROW_HEIGHT + 9;
|
||||
GfxFillRectInset(
|
||||
&dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1],
|
||||
dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
// Preferred Ride
|
||||
|
@ -1354,7 +1354,7 @@ private:
|
|||
void OnScrollDrawRides(int32_t scrollIndex, DrawPixelInfo& dpi)
|
||||
{
|
||||
auto 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 listIndex = 0; listIndex < no_list_items; listIndex++)
|
||||
{
|
||||
|
@ -1362,7 +1362,7 @@ private:
|
|||
StringId stringId = STR_BLACK_STRING;
|
||||
if (listIndex == selected_list_item)
|
||||
{
|
||||
GfxFilterRect(&dpi, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1);
|
||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
}
|
||||
|
||||
|
@ -1443,7 +1443,7 @@ private:
|
|||
}
|
||||
|
||||
GfxFillRectInset(
|
||||
&dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1],
|
||||
dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
// Paid to enter
|
||||
|
|
|
@ -589,7 +589,7 @@ public:
|
|||
void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override
|
||||
{
|
||||
GfxFillRect(
|
||||
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
switch (_selectedTab)
|
||||
{
|
||||
case TabId::Individual:
|
||||
|
@ -669,7 +669,7 @@ private:
|
|||
StringId format = STR_BLACK_STRING;
|
||||
if (index == _highlightedIndex)
|
||||
{
|
||||
GfxFilterRect(&dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||
format = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
}
|
||||
|
||||
|
@ -739,7 +739,7 @@ private:
|
|||
StringId format = STR_BLACK_STRING;
|
||||
if (index == _highlightedIndex)
|
||||
{
|
||||
GfxFilterRect(&dpi, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
||||
format = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ public:
|
|||
Widget* widget = &window_install_track_widgets[WIDX_TRACK_PREVIEW];
|
||||
auto screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 };
|
||||
int32_t colour = ColourMapA[colours[0]].darkest;
|
||||
GfxFillRect(&dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour);
|
||||
GfxFillRect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour);
|
||||
|
||||
G1Element g1temp = {};
|
||||
g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE);
|
||||
|
|
|
@ -970,7 +970,7 @@ public:
|
|||
void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override
|
||||
{
|
||||
GfxFillRect(
|
||||
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
const int32_t listWidth = widgets[WIDX_SCROLL].width();
|
||||
const int32_t dateAnchor = widgets[WIDX_SORT_DATE].left + maxDateWidth + DATE_TIME_GAP;
|
||||
|
||||
|
@ -989,7 +989,7 @@ public:
|
|||
if (i == selected_list_item)
|
||||
{
|
||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
GfxFilterRect(&dpi, { 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
||||
}
|
||||
// display a marker next to the currently loaded game file
|
||||
if (_listItems[i].loaded)
|
||||
|
|
|
@ -894,7 +894,7 @@ public:
|
|||
for (uint32_t i = 0; i < std::size(RideKeyColours); i++)
|
||||
{
|
||||
GfxFillRect(
|
||||
&dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } },
|
||||
dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } },
|
||||
RideKeyColours[i]);
|
||||
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, _mapLabels[i], {});
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
@ -1194,7 +1194,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
GfxFillRect(&dpi, { leftTop, rightBottom }, colour);
|
||||
GfxFillRect(dpi, { leftTop, rightBottom }, colour);
|
||||
}
|
||||
|
||||
static uint8_t GetGuestFlashColour()
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1259,20 +1259,20 @@ 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)
|
||||
|
|
|
@ -596,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];
|
||||
|
@ -869,7 +869,7 @@ static void WindowMultiplayerGroupsPaint(WindowBase* w, DrawPixelInfo& dpi)
|
|||
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];
|
||||
|
@ -892,14 +892,14 @@ static void WindowMultiplayerGroupsScrollpaint(WindowBase* w, DrawPixelInfo& dpi
|
|||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -490,7 +490,7 @@ public:
|
|||
buttonFlags |= INSET_RECT_FLAG_BORDER_INSET;
|
||||
if (new_ride.HighlightedRide == *listItem || buttonFlags != 0)
|
||||
GfxFillRectInset(
|
||||
&dpi, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1],
|
||||
dpi, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1],
|
||||
INSET_RECT_FLAG_FILL_MID_LIGHT | buttonFlags);
|
||||
|
||||
// Draw ride image with feathered border
|
||||
|
|
|
@ -191,7 +191,7 @@ public:
|
|||
|
||||
// Background
|
||||
GfxFillRectInset(
|
||||
&dpi, { -1, y, 383, y + itemHeight - 1 }, colours[1],
|
||||
dpi, { -1, y, 383, y + itemHeight - 1 }, colours[1],
|
||||
(INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_GREY));
|
||||
|
||||
// Date text
|
||||
|
@ -221,7 +221,7 @@ public:
|
|||
press = INSET_RECT_FLAG_BORDER_INSET;
|
||||
}
|
||||
}
|
||||
GfxFillRectInset(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
|
||||
GfxFillRectInset(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
|
||||
|
||||
switch (newsItem.Type)
|
||||
{
|
||||
|
@ -298,7 +298,7 @@ public:
|
|||
if (i == _pressedNewsItemIndex && _pressedButtonIndex == 2)
|
||||
press = 0x20;
|
||||
}
|
||||
GfxFillRectInset(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
|
||||
GfxFillRectInset(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
|
||||
GfxDrawSprite(dpi, ImageId(SPR_LOCATE), screenCoords);
|
||||
}
|
||||
|
||||
|
|
|
@ -505,7 +505,7 @@ public:
|
|||
{
|
||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||
GfxFillRect(
|
||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
const int32_t listWidth = widgets[WIDX_SCROLL].width();
|
||||
|
||||
for (int32_t i = 0; i < no_list_items; i++)
|
||||
|
@ -522,11 +522,11 @@ public:
|
|||
{ listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
|
||||
// If hovering over item, change the color and fill the backdrop.
|
||||
if (i == selected_list_item)
|
||||
GfxFillRect(&dpi, screenRect, ColourMapA[colours[1]].darker);
|
||||
GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].darker);
|
||||
else if (i == _highlightedIndex)
|
||||
GfxFillRect(&dpi, screenRect, ColourMapA[colours[1]].mid_dark);
|
||||
GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].mid_dark);
|
||||
else if ((i & 1) != 0) // odd / even check
|
||||
GfxFillRect(&dpi, screenRect, ColourMapA[colours[1]].light);
|
||||
GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].light);
|
||||
|
||||
// Draw the actual object entry's name...
|
||||
screenCoords.x = NAME_COL_LEFT - 3;
|
||||
|
|
|
@ -700,7 +700,7 @@ private:
|
|||
|
||||
// Graph border
|
||||
GfxFillRectInset(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 },
|
||||
screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } },
|
||||
colours[1], INSET_RECT_F_30);
|
||||
|
@ -715,7 +715,7 @@ private:
|
|||
DrawTextBasic(
|
||||
dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, { FontStyle::Small, TextAlignment::RIGHT });
|
||||
GfxFillRectInset(
|
||||
&dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
|
||||
dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
screenPos.y += 20;
|
||||
}
|
||||
|
@ -772,7 +772,7 @@ private:
|
|||
|
||||
// Graph border
|
||||
GfxFillRectInset(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 },
|
||||
screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } },
|
||||
colours[1], INSET_RECT_F_30);
|
||||
|
@ -787,7 +787,7 @@ private:
|
|||
DrawTextBasic(
|
||||
dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, { FontStyle::Small, TextAlignment::RIGHT });
|
||||
GfxFillRectInset(
|
||||
&dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
|
||||
dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
screenPos.y += 20;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -3786,7 +3786,7 @@ static void WindowRideLocateMechanic(WindowBase* w)
|
|||
static void WindowRideMaintenanceDrawBar(
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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 };
|
||||
|
@ -5654,7 +5654,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo& dpi)
|
|||
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
|
||||
{
|
||||
|
@ -5703,7 +5703,7 @@ static void WindowRideMeasurementsPaint(WindowBase* w, DrawPixelInfo& dpi)
|
|||
|
||||
// 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))
|
||||
|
@ -6169,11 +6169,11 @@ static void WindowRideGraphsScrollpaint(WindowBase* w, DrawPixelInfo& dpi, int32
|
|||
{
|
||||
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);
|
||||
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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -526,7 +526,7 @@ public:
|
|||
void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override
|
||||
{
|
||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||
GfxFillRect(&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width, dpi.height } }, ColourMapA[colours[1]].mid_light);
|
||||
GfxFillRect(dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width, dpi.height } }, ColourMapA[colours[1]].mid_light);
|
||||
|
||||
auto y = 0;
|
||||
for (size_t i = 0; i < _rideList.size(); i++)
|
||||
|
@ -535,7 +535,7 @@ public:
|
|||
if (i == static_cast<size_t>(selected_list_item))
|
||||
{
|
||||
// Background highlight
|
||||
GfxFilterRect(&dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
|
||||
format = (_quickDemolishMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
|
||||
}
|
||||
|
||||
|
|
|
@ -448,7 +448,7 @@ public:
|
|||
bool isHighlighted = highlighted_scenario == scenario;
|
||||
if (isHighlighted)
|
||||
{
|
||||
GfxFilterRect(&dpi, { 0, y, width, y + scenarioItemHeight - 1 }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, y, width, y + scenarioItemHeight - 1 }, FilterPaletteID::PaletteDarken1);
|
||||
}
|
||||
|
||||
bool isCompleted = scenario->Highscore != nullptr;
|
||||
|
@ -521,21 +521,21 @@ private:
|
|||
int32_t lineY = y + 4;
|
||||
auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY };
|
||||
auto lightLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY };
|
||||
GfxDrawLine(&dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||
GfxDrawLine(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour);
|
||||
|
||||
auto lightLineLeftTop2 = ScreenCoordsXY{ strRight, lineY };
|
||||
auto lightLineRightBottom2 = ScreenCoordsXY{ right, lineY };
|
||||
GfxDrawLine(&dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour);
|
||||
GfxDrawLine(dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour);
|
||||
|
||||
// Draw dark horizontal rule
|
||||
lineY++;
|
||||
auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY };
|
||||
auto darkLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY };
|
||||
GfxDrawLine(&dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||
GfxDrawLine(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour);
|
||||
|
||||
auto darkLineLeftTop2 = ScreenCoordsXY{ strRight, lineY };
|
||||
auto darkLineRightBottom2 = ScreenCoordsXY{ right, lineY };
|
||||
GfxDrawLine(&dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour);
|
||||
GfxDrawLine(dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour);
|
||||
}
|
||||
|
||||
void InitialiseListItems()
|
||||
|
|
|
@ -1596,7 +1596,7 @@ private:
|
|||
if (_selectedScenery == currentSceneryGlobal)
|
||||
{
|
||||
GfxFillRectInset(
|
||||
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||
dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||
colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT);
|
||||
}
|
||||
}
|
||||
|
@ -1605,13 +1605,13 @@ private:
|
|||
if (tabSelectedScenery == currentSceneryGlobal)
|
||||
{
|
||||
GfxFillRectInset(
|
||||
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||
dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||
colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT));
|
||||
}
|
||||
else if (_selectedScenery == currentSceneryGlobal)
|
||||
{
|
||||
GfxFillRectInset(
|
||||
&dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||
dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } },
|
||||
colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -350,8 +350,7 @@ public:
|
|||
if (highlighted)
|
||||
{
|
||||
GfxFilterRect(
|
||||
&dpi, { 0, screenCoords.y, listWidgetWidth, screenCoords.y + ITEM_HEIGHT },
|
||||
FilterPaletteID::PaletteDarken1);
|
||||
dpi, { 0, screenCoords.y, listWidgetWidth, screenCoords.y + ITEM_HEIGHT }, FilterPaletteID::PaletteDarken1);
|
||||
_version = serverDetails.Version;
|
||||
}
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ public:
|
|||
{
|
||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||
GfxFillRect(
|
||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
|
||||
// TODO: the line below is a workaround for what is presumably a bug with dpi->width
|
||||
// see https://github.com/OpenRCT2/OpenRCT2/issues/11238 for details
|
||||
|
@ -498,8 +498,8 @@ private:
|
|||
void DrawSeparator(DrawPixelInfo& dpi, int32_t y, int32_t scrollWidth)
|
||||
{
|
||||
const int32_t top = y + (SCROLLABLE_ROW_HEIGHT / 2) - 1;
|
||||
GfxFillRect(&dpi, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[0]].mid_dark);
|
||||
GfxFillRect(&dpi, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[0]].lightest);
|
||||
GfxFillRect(dpi, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[0]].mid_dark);
|
||||
GfxFillRect(dpi, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[0]].lightest);
|
||||
}
|
||||
|
||||
void DrawItem(DrawPixelInfo& dpi, int32_t y, int32_t scrollWidth, const ShortcutStringPair& shortcut, bool isHighlighted)
|
||||
|
@ -508,7 +508,7 @@ private:
|
|||
if (isHighlighted)
|
||||
{
|
||||
format = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
GfxFilterRect(&dpi, { 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2) }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2) }, FilterPaletteID::PaletteDarken1);
|
||||
}
|
||||
|
||||
auto bindingOffset = (scrollWidth * 2) / 3;
|
||||
|
|
|
@ -377,7 +377,7 @@ public:
|
|||
{
|
||||
auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y };
|
||||
GfxFillRect(
|
||||
&dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
|
||||
// How much space do we have for the name and action columns? (Discount scroll area and icons.)
|
||||
const int32_t nonIconSpace = widgets[WIDX_STAFF_LIST_LIST].width() - 15 - 68;
|
||||
|
@ -405,7 +405,7 @@ public:
|
|||
|
||||
if (i == _highlightedIndex)
|
||||
{
|
||||
GfxFilterRect(&dpi, { 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1) }, FilterPaletteID::PaletteDarken1);
|
||||
GfxFilterRect(dpi, { 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1) }, FilterPaletteID::PaletteDarken1);
|
||||
format = (_quickFireMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
|
||||
}
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ public:
|
|||
u8string_view{ _buffer.data(), _buffer.size() }, WW - (24 + 13), FontStyle::Medium, &wrappedString, &no_lines);
|
||||
|
||||
GfxFillRectInset(
|
||||
&dpi, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } },
|
||||
dpi, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } },
|
||||
colours[1], INSET_RECT_F_60);
|
||||
|
||||
screenCoords.y += 1;
|
||||
|
@ -270,7 +270,7 @@ public:
|
|||
uint8_t colour = ColourMapA[colours[1]].mid_light;
|
||||
// TODO: palette index addition
|
||||
GfxFillRect(
|
||||
&dpi, { { cursorX, screenCoords.y + 9 }, { cursorX + textWidth, screenCoords.y + 9 } }, colour + 5);
|
||||
dpi, { { cursorX, screenCoords.y + 9 }, { cursorX + textWidth, screenCoords.y + 9 } }, colour + 5);
|
||||
}
|
||||
|
||||
cur_drawn++;
|
||||
|
@ -322,9 +322,9 @@ private:
|
|||
int height = 10;
|
||||
|
||||
GfxFillRect(
|
||||
&dpi, { screenCoords - ScreenCoordsXY{ 1, 1 }, screenCoords + ScreenCoordsXY{ width + 1, height + 1 } },
|
||||
dpi, { screenCoords - ScreenCoordsXY{ 1, 1 }, screenCoords + ScreenCoordsXY{ width + 1, height + 1 } },
|
||||
PALETTE_INDEX_12);
|
||||
GfxFillRect(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ width, height } }, PALETTE_INDEX_0);
|
||||
GfxFillRect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ width, height } }, PALETTE_INDEX_0);
|
||||
GfxDrawString(dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
|
||||
}
|
||||
|
||||
|
|
|
@ -792,16 +792,16 @@ public:
|
|||
{
|
||||
TranslucentWindowPalette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)];
|
||||
|
||||
GfxFilterRect(&dpi, { leftTop, rightBottom }, windowPalette.highlight);
|
||||
GfxFilterRect(&dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow);
|
||||
GfxFilterRect(dpi, { leftTop, rightBottom }, windowPalette.highlight);
|
||||
GfxFilterRect(dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow);
|
||||
}
|
||||
else
|
||||
{
|
||||
colour = ColourMapA[colours[1]].mid_dark;
|
||||
GfxFillRect(&dpi, { leftTop, rightBottom }, colour);
|
||||
GfxFillRect(dpi, { leftTop, rightBottom }, colour);
|
||||
|
||||
colour = ColourMapA[colours[1]].lightest;
|
||||
GfxFillRect(&dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour);
|
||||
GfxFillRect(dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -819,7 +819,7 @@ public:
|
|||
|
||||
ScreenCoordsXY topLeft{ _button_offset_x + 12 * j, screenCoords.y + _check_offset_y };
|
||||
ScreenCoordsXY bottomRight{ _button_offset_x + 12 * j + 9, screenCoords.y + _check_offset_y + 10 };
|
||||
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_E0);
|
||||
GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_E0);
|
||||
if (colour & COLOUR_FLAG_TRANSLUCENT)
|
||||
{
|
||||
GfxDrawString(
|
||||
|
|
|
@ -1540,7 +1540,7 @@ public:
|
|||
{
|
||||
const int32_t listWidth = widgets[WIDX_LIST].width();
|
||||
GfxFillRect(
|
||||
&dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light);
|
||||
|
||||
// Show usage hint when nothing is selected
|
||||
if (!_tileSelected)
|
||||
|
@ -1573,12 +1573,12 @@ public:
|
|||
// Draw row background colour
|
||||
auto fillRectangle = ScreenRect{ { 0, screenCoords.y }, { listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
|
||||
if (selectedRow)
|
||||
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||
GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
|
||||
else if (hoveredRow)
|
||||
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].mid_dark | 0x1000000);
|
||||
GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark | 0x1000000);
|
||||
// Zebra stripes
|
||||
else if (((windowTileInspectorElementCount - i) & 1) == 0)
|
||||
GfxFillRect(&dpi, fillRectangle, ColourMapA[colours[1]].light | 0x1000000);
|
||||
GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].light | 0x1000000);
|
||||
|
||||
const StringId stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID;
|
||||
auto checkboxFormatter = Formatter();
|
||||
|
@ -1586,7 +1586,7 @@ public:
|
|||
checkboxFormatter.Add<char*>(CheckBoxMarkString);
|
||||
|
||||
// Draw checkbox and check if visible
|
||||
GfxFillRectInset(&dpi, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], INSET_RECT_F_E0);
|
||||
GfxFillRectInset(dpi, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], INSET_RECT_F_E0);
|
||||
if (!tileElement->IsInvisible())
|
||||
{
|
||||
auto eyeFormatter = Formatter();
|
||||
|
|
|
@ -269,7 +269,7 @@ public:
|
|||
|
||||
void OnDraw(DrawPixelInfo& dpi) override
|
||||
{
|
||||
GfxFilterRect(&dpi, _filterRect, FilterPaletteID::Palette51);
|
||||
GfxFilterRect(dpi, _filterRect, FilterPaletteID::Palette51);
|
||||
DrawWidgets(dpi);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -82,14 +82,14 @@ public:
|
|||
int32_t bottom = windowPos.y + height - 1;
|
||||
|
||||
// Background
|
||||
GfxFilterRect(&dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::Palette45);
|
||||
GfxFilterRect(&dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::PaletteGlassLightOrange);
|
||||
GfxFilterRect(dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::Palette45);
|
||||
GfxFilterRect(dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::PaletteGlassLightOrange);
|
||||
|
||||
// Sides
|
||||
GfxFilterRect(&dpi, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(&dpi, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(&dpi, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(&dpi, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(dpi, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(dpi, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(dpi, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::PaletteDarken3);
|
||||
GfxFilterRect(dpi, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::PaletteDarken3);
|
||||
|
||||
// Corners
|
||||
GfxFilterPixel(&dpi, { left + 1, top + 1 }, FilterPaletteID::PaletteDarken3);
|
||||
|
|
|
@ -473,7 +473,7 @@ public:
|
|||
}
|
||||
|
||||
auto screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.top + 1 };
|
||||
GfxFillRect(&dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); // TODO Check dpi
|
||||
GfxFillRect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); // TODO Check dpi
|
||||
|
||||
if (_loadedTrackDesignIndex != trackIndex)
|
||||
{
|
||||
|
@ -689,7 +689,7 @@ public:
|
|||
{
|
||||
// Highlight
|
||||
GfxFilterRect(
|
||||
&dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
|
||||
dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
|
||||
FilterPaletteID::PaletteDarken1);
|
||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
}
|
||||
|
@ -714,7 +714,7 @@ public:
|
|||
{
|
||||
// Highlight
|
||||
GfxFilterRect(
|
||||
&dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
|
||||
dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
|
||||
FilterPaletteID::PaletteDarken1);
|
||||
stringId = STR_WINDOW_COLOUR_2_STRINGID;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ void IntroDraw(DrawPixelInfo& dpi)
|
|||
|
||||
// Draw a white rectangle for the logo background (gives a bit of white margin)
|
||||
GfxFillRect(
|
||||
&dpi,
|
||||
dpi,
|
||||
{ { (screenWidth / 2) - 320 + 50, _introStateCounter + 50 },
|
||||
{ (screenWidth / 2) - 320 + 50 + 540, _introStateCounter + 50 + 425 } },
|
||||
BORDER_COLOUR_PUBLISHER);
|
||||
|
|
|
@ -735,7 +735,7 @@ void MaskInit()
|
|||
|
||||
void GfxFilterPixel(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, FilterPaletteID palette)
|
||||
{
|
||||
GfxFilterRect(dpi, { coords, coords }, palette);
|
||||
GfxFilterRect(*dpi, { coords, coords }, palette);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -517,15 +517,15 @@ void GfxInvalidatePickedUpPeep();
|
|||
void GfxDrawPickedUpPeep(DrawPixelInfo* dpi);
|
||||
|
||||
// line
|
||||
void GfxDrawLine(DrawPixelInfo* dpi, const ScreenLine& line, int32_t colour);
|
||||
void GfxDrawLine(DrawPixelInfo& dpi, const ScreenLine& line, int32_t colour);
|
||||
void GfxDrawLineSoftware(DrawPixelInfo& dpi, const ScreenLine& line, int32_t colour);
|
||||
void GfxDrawDashedLine(
|
||||
DrawPixelInfo* dpi, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color);
|
||||
DrawPixelInfo& dpi, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color);
|
||||
|
||||
// rect
|
||||
void GfxFillRect(DrawPixelInfo* dpi, const ScreenRect& rect, int32_t colour);
|
||||
void GfxFillRectInset(DrawPixelInfo* dpi, const ScreenRect& rect, int32_t colour, uint8_t flags);
|
||||
void GfxFilterRect(DrawPixelInfo* dpi, const ScreenRect& rect, FilterPaletteID palette);
|
||||
void GfxFillRect(DrawPixelInfo& dpi, const ScreenRect& rect, int32_t colour);
|
||||
void GfxFillRectInset(DrawPixelInfo& dpi, const ScreenRect& rect, int32_t colour, uint8_t flags);
|
||||
void GfxFilterRect(DrawPixelInfo& dpi, const ScreenRect& rect, FilterPaletteID palette);
|
||||
|
||||
// sprite
|
||||
bool GfxLoadG1(const OpenRCT2::IPlatformEnvironment& env);
|
||||
|
|
|
@ -170,42 +170,42 @@ void GfxClear(DrawPixelInfo* dpi, uint8_t paletteIndex)
|
|||
}
|
||||
}
|
||||
|
||||
void GfxFillRect(DrawPixelInfo* dpi, const ScreenRect& rect, int32_t colour)
|
||||
void GfxFillRect(DrawPixelInfo& dpi, const ScreenRect& rect, int32_t colour)
|
||||
{
|
||||
auto drawingEngine = dpi->DrawingEngine;
|
||||
auto drawingEngine = dpi.DrawingEngine;
|
||||
if (drawingEngine != nullptr)
|
||||
{
|
||||
IDrawingContext* dc = drawingEngine->GetDrawingContext();
|
||||
dc->FillRect(dpi, colour, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom());
|
||||
dc->FillRect(&dpi, colour, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom());
|
||||
}
|
||||
}
|
||||
|
||||
void GfxFilterRect(DrawPixelInfo* dpi, const ScreenRect& rect, FilterPaletteID palette)
|
||||
void GfxFilterRect(DrawPixelInfo& dpi, const ScreenRect& rect, FilterPaletteID palette)
|
||||
{
|
||||
auto drawingEngine = dpi->DrawingEngine;
|
||||
auto drawingEngine = dpi.DrawingEngine;
|
||||
if (drawingEngine != nullptr)
|
||||
{
|
||||
IDrawingContext* dc = drawingEngine->GetDrawingContext();
|
||||
dc->FilterRect(dpi, palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom());
|
||||
dc->FilterRect(&dpi, palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom());
|
||||
}
|
||||
}
|
||||
|
||||
void GfxDrawLine(DrawPixelInfo* dpi, const ScreenLine& line, int32_t colour)
|
||||
void GfxDrawLine(DrawPixelInfo& dpi, const ScreenLine& line, int32_t colour)
|
||||
{
|
||||
auto drawingEngine = dpi->DrawingEngine;
|
||||
auto drawingEngine = dpi.DrawingEngine;
|
||||
if (drawingEngine != nullptr)
|
||||
{
|
||||
IDrawingContext* dc = drawingEngine->GetDrawingContext();
|
||||
dc->DrawLine(dpi, colour, line);
|
||||
dc->DrawLine(&dpi, colour, line);
|
||||
}
|
||||
}
|
||||
|
||||
void GfxDrawDashedLine(
|
||||
DrawPixelInfo* dpi, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color)
|
||||
DrawPixelInfo& dpi, const ScreenLine& screenLine, const int32_t dashedLineSegmentLength, const int32_t color)
|
||||
{
|
||||
assert(dashedLineSegmentLength > 0);
|
||||
|
||||
const auto drawingEngine = dpi->DrawingEngine;
|
||||
const auto drawingEngine = dpi.DrawingEngine;
|
||||
if (drawingEngine != nullptr)
|
||||
{
|
||||
constexpr int32_t precisionFactor = 1000;
|
||||
|
@ -228,7 +228,7 @@ void GfxDrawDashedLine(
|
|||
{
|
||||
x = screenLine.GetX1() + dxPrecise * i * 2 / precisionFactor;
|
||||
y = screenLine.GetY1() + dyPrecise * i * 2 / precisionFactor;
|
||||
dc->DrawLine(dpi, color, { { x, y }, { x + dxPrecise / precisionFactor, y + dyPrecise / precisionFactor } });
|
||||
dc->DrawLine(&dpi, color, { { x, y }, { x + dxPrecise / precisionFactor, y + dyPrecise / precisionFactor } });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* colour (ebp)
|
||||
* flags (si)
|
||||
*/
|
||||
void GfxFillRectInset(DrawPixelInfo* dpi, const ScreenRect& rect, int32_t colour, uint8_t flags)
|
||||
void GfxFillRectInset(DrawPixelInfo& dpi, const ScreenRect& rect, int32_t colour, uint8_t flags)
|
||||
{
|
||||
const auto leftTop = ScreenCoordsXY{ rect.GetLeft(), rect.GetTop() };
|
||||
const auto leftBottom = ScreenCoordsXY{ rect.GetLeft(), rect.GetBottom() };
|
||||
|
|
|
@ -98,12 +98,12 @@ void DrawText(
|
|||
if (paint.UnderlineText == TextUnderline::On)
|
||||
{
|
||||
GfxFillRect(
|
||||
&dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } },
|
||||
dpi, { { alignedCoords + ScreenCoordsXY{ 0, 11 } }, { alignedCoords + ScreenCoordsXY{ width, 11 } } },
|
||||
gTextPalette[1]);
|
||||
if (gTextPalette[2] != 0)
|
||||
{
|
||||
GfxFillRect(
|
||||
&dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } },
|
||||
dpi, { { alignedCoords + ScreenCoordsXY{ 1, 12 } }, { alignedCoords + ScreenCoordsXY{ width + 1, 12 } } },
|
||||
gTextPalette[2]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,16 +140,16 @@ void ChatDraw(DrawPixelInfo& dpi, uint8_t chatBackgroundColor)
|
|||
GfxSetDirtyBlocks(
|
||||
{ topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }); // Background area + Textbox
|
||||
GfxFilterRect(
|
||||
&dpi, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } },
|
||||
dpi, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } },
|
||||
FilterPaletteID::Palette51); // Opaque grey background
|
||||
GfxFillRectInset(
|
||||
&dpi, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }, chatBackgroundColor,
|
||||
dpi, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }, chatBackgroundColor,
|
||||
INSET_RECT_FLAG_FILL_NONE);
|
||||
GfxFillRectInset(
|
||||
&dpi, { topLeft + ScreenCoordsXY{ 1, -4 }, bottomRight - ScreenCoordsXY{ 1, inputLineHeight + 6 } },
|
||||
dpi, { topLeft + ScreenCoordsXY{ 1, -4 }, bottomRight - ScreenCoordsXY{ 1, inputLineHeight + 6 } },
|
||||
chatBackgroundColor, INSET_RECT_FLAG_BORDER_INSET);
|
||||
GfxFillRectInset(
|
||||
&dpi, { bottomLeft + ScreenCoordsXY{ 1, -inputLineHeight - 5 }, bottomRight + ScreenCoordsXY{ -1, 4 } },
|
||||
dpi, { bottomLeft + ScreenCoordsXY{ 1, -inputLineHeight - 5 }, bottomRight + ScreenCoordsXY{ -1, 4 } },
|
||||
chatBackgroundColor,
|
||||
INSET_RECT_FLAG_BORDER_INSET); // Textbox
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ void ChatDraw(DrawPixelInfo& dpi, uint8_t chatBackgroundColor)
|
|||
int32_t caretX = screenCoords.x + GfxGetStringWidth(lineBuffer, FontStyle::Medium);
|
||||
int32_t caretY = screenCoords.y + 14;
|
||||
|
||||
GfxFillRect(&dpi, { { caretX, caretY }, { caretX + 6, caretY + 1 } }, PALETTE_INDEX_56);
|
||||
GfxFillRect(dpi, { { caretX, caretY }, { caretX + 6, caretY + 1 } }, PALETTE_INDEX_56);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1104,7 +1104,7 @@ static void ViewportPaintWeatherGloom(DrawPixelInfo& dpi)
|
|||
auto y = dpi.y;
|
||||
auto w = zoomLevel.ApplyInversedTo(dpi.width) - 1;
|
||||
auto h = zoomLevel.ApplyInversedTo(dpi.height) - 1;
|
||||
GfxFilterRect(&dpi, ScreenRect(x, y, x + w, y + h), paletteId);
|
||||
GfxFilterRect(dpi, ScreenRect(x, y, x + w, y + h), paletteId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -624,28 +624,28 @@ static void PaintPSImageWithBoundingBoxes(DrawPixelInfo& dpi, PaintStruct* ps, I
|
|||
const auto screenCoordBackBottom = Translate3DTo2DWithZ(rotation, backBottom);
|
||||
|
||||
// bottom square
|
||||
GfxDrawLine(&dpi, { screenCoordFrontBottom, screenCoordLeftBottom }, colour);
|
||||
GfxDrawLine(&dpi, { screenCoordBackBottom, screenCoordLeftBottom }, colour);
|
||||
GfxDrawLine(&dpi, { screenCoordBackBottom, screenCoordRightBottom }, colour);
|
||||
GfxDrawLine(&dpi, { screenCoordFrontBottom, screenCoordRightBottom }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordFrontBottom, screenCoordLeftBottom }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordBackBottom, screenCoordLeftBottom }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordBackBottom, screenCoordRightBottom }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordFrontBottom, screenCoordRightBottom }, colour);
|
||||
|
||||
// vertical back + sides
|
||||
GfxDrawLine(&dpi, { screenCoordBackTop, screenCoordBackBottom }, colour);
|
||||
GfxDrawLine(&dpi, { screenCoordLeftTop, screenCoordLeftBottom }, colour);
|
||||
GfxDrawLine(&dpi, { screenCoordRightTop, screenCoordRightBottom }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordBackTop, screenCoordBackBottom }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordLeftTop, screenCoordLeftBottom }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordRightTop, screenCoordRightBottom }, colour);
|
||||
|
||||
// top square back
|
||||
GfxDrawLine(&dpi, { screenCoordBackTop, screenCoordLeftTop }, colour);
|
||||
GfxDrawLine(&dpi, { screenCoordBackTop, screenCoordRightTop }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordBackTop, screenCoordLeftTop }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordBackTop, screenCoordRightTop }, colour);
|
||||
|
||||
GfxDrawSprite(dpi, imageId, { x, y });
|
||||
|
||||
// vertical front
|
||||
GfxDrawLine(&dpi, { screenCoordFrontTop, screenCoordFrontBottom }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordFrontTop, screenCoordFrontBottom }, colour);
|
||||
|
||||
// top square
|
||||
GfxDrawLine(&dpi, { screenCoordFrontTop, screenCoordLeftTop }, colour);
|
||||
GfxDrawLine(&dpi, { screenCoordFrontTop, screenCoordRightTop }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordFrontTop, screenCoordLeftTop }, colour);
|
||||
GfxDrawLine(dpi, { screenCoordFrontTop, screenCoordRightTop }, colour);
|
||||
}
|
||||
|
||||
static ImageId PaintPSColourifyImage(const PaintStruct* ps, ImageId imageId, uint32_t viewFlags)
|
||||
|
|
Loading…
Reference in New Issue