1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Part of #12098: Use ScreenRect on gfx_filter_rect (#12134)

This commit is contained in:
annoyingdroid
2020-08-01 13:40:01 -04:00
committed by GitHub
parent bf08943929
commit ddd21fa87a
4 changed files with 8 additions and 6 deletions

View File

@@ -290,10 +290,11 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
Invalidate(); Invalidate();
// Give console area a translucent effect. // Give console area a translucent effect.
gfx_filter_rect(dpi, _consoleLeft, _consoleTop, _consoleRight, _consoleBottom, PALETTE_51); gfx_filter_rect(dpi, { { _consoleLeft, _consoleTop }, { _consoleRight, _consoleBottom } }, PALETTE_51);
// Make input area more opaque. // Make input area more opaque.
gfx_filter_rect(dpi, _consoleLeft, _consoleBottom - lineHeight - 10, _consoleRight, _consoleBottom - 1, PALETTE_51); gfx_filter_rect(
dpi, { { _consoleLeft, _consoleBottom - lineHeight - 10 }, { _consoleRight, _consoleBottom - 1 } }, PALETTE_51);
// Paint background colour. // Paint background colour.
uint8_t backgroundColour = theme_get_colour(WC_CONSOLE, 0); uint8_t backgroundColour = theme_get_colour(WC_CONSOLE, 0);

View File

@@ -532,7 +532,8 @@ static void widget_caption_draw(rct_drawpixelinfo* dpi, rct_window* w, rct_widge
gfx_fill_rect( gfx_fill_rect(
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 else
gfx_filter_rect(dpi, topLeft.x + 1, topLeft.y + 1, bottomRight.x - 1, bottomRight.y - 1, PALETTE_DARKEN_3); gfx_filter_rect(
dpi, { { topLeft + ScreenCoordsXY{ 1, 1 } }, { bottomRight - ScreenCoordsXY{ 1, 1 } } }, PALETTE_DARKEN_3);
// Draw text // Draw text
if (widget->text == STR_NONE) if (widget->text == STR_NONE)

View File

@@ -587,7 +587,7 @@ void window_draw_widgets(rct_window* w, rct_drawpixelinfo* dpi)
if ((w->flags & WF_TRANSPARENT) && !(w->flags & WF_NO_BACKGROUND)) if ((w->flags & WF_TRANSPARENT) && !(w->flags & WF_NO_BACKGROUND))
gfx_filter_rect( gfx_filter_rect(
dpi, w->windowPos.x, w->windowPos.y, w->windowPos.x + w->width - 1, w->windowPos.y + w->height - 1, PALETTE_51); dpi, { w->windowPos, w->windowPos + ScreenCoordsXY{ w->width - 1, w->windowPos.y + w->height - 1 } }, PALETTE_51);
// todo: some code missing here? Between 006EB18C and 006EB260 // todo: some code missing here? Between 006EB18C and 006EB260

View File

@@ -557,11 +557,11 @@ void CustomListView::Paint(rct_window* w, rct_drawpixelinfo* dpi, const rct_scro
auto isSelected = (SelectedCell && itemIndex == SelectedCell->Row); auto isSelected = (SelectedCell && itemIndex == SelectedCell->Row);
if (isSelected) if (isSelected)
{ {
gfx_filter_rect(dpi, dpi->x, y, dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1), PALETTE_DARKEN_2); gfx_filter_rect(dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1) } }, PALETTE_DARKEN_2);
} }
else if (isHighlighted) else if (isHighlighted)
{ {
gfx_filter_rect(dpi, dpi->x, y, dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1), PALETTE_DARKEN_1); gfx_filter_rect(dpi, { { dpi->x, y }, { dpi->x + dpi->width, y + (LIST_ROW_HEIGHT - 1) } }, PALETTE_DARKEN_1);
} }
else if (isStriped) else if (isStriped)
{ {