Remove raw coords gfx_fill_rect_inset overload

This commit is contained in:
Tulio Leao 2021-03-27 00:50:19 -03:00
parent 08e182fba2
commit bb8c275df6
8 changed files with 15 additions and 26 deletions

View File

@ -308,9 +308,9 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
// Paint background colour.
uint8_t backgroundColour = ThemeGetColour(WC_CONSOLE, 0);
gfx_fill_rect_inset(
dpi, _consoleLeft, _consoleTop, _consoleRight, _consoleBottom, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
dpi, { { _consoleLeft, _consoleTop }, { _consoleRight, _consoleBottom } }, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
gfx_fill_rect_inset(
dpi, _consoleLeft + 1, _consoleTop + 1, _consoleRight - 1, _consoleBottom - 1, backgroundColour,
dpi, { { _consoleLeft + 1, _consoleTop + 1 }, { _consoleRight - 1, _consoleBottom - 1 } }, backgroundColour,
INSET_RECT_FLAG_BORDER_INSET);
std::string lineBuffer;

View File

@ -650,7 +650,7 @@ void WindowDrawWidgets(rct_window* w, rct_drawpixelinfo* dpi)
if (w->flags & WF_WHITE_BORDER_MASK)
{
gfx_fill_rect_inset(
dpi, w->windowPos.x, w->windowPos.y, w->windowPos.x + w->width - 1, w->windowPos.y + w->height - 1, COLOUR_WHITE,
dpi, { w->windowPos, w->windowPos + ScreenCoordsXY{ w->width - 1, w->height - 1 } }, COLOUR_WHITE,
INSET_RECT_FLAG_FILL_NONE);
}
}

View File

@ -671,7 +671,7 @@ void CustomListView::PaintHeading(
{
boxFlags = INSET_RECT_FLAG_BORDER_INSET;
}
gfx_fill_rect_inset(dpi, pos.x, pos.y, pos.x + size.width - 1, pos.y + size.height - 1, w->colours[1], boxFlags);
gfx_fill_rect_inset(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);

View File

@ -409,24 +409,20 @@ void window_editor_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* dpi)
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER))
{
const auto topLeft = w->windowPos
+ ScreenCoordsXY{ window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + 1,
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 1 };
const auto bottomRight = w->windowPos
+ ScreenCoordsXY{ window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right - 1,
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 };
if (drawPreviousButton)
{
gfx_fill_rect_inset(
dpi, window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].left + 1 + w->windowPos.x,
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].top + 1 + w->windowPos.y,
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right - 1 + w->windowPos.x,
window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 + w->windowPos.y, w->colours[1],
INSET_RECT_F_30);
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
}
if ((drawPreviousButton || drawNextButton) && gS6Info.editor_step != EditorStep::RollercoasterDesigner)
{
gfx_fill_rect_inset(
dpi, window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].left + 1 + w->windowPos.x,
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].top + 1 + w->windowPos.y,
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].right - 1 + w->windowPos.x,
window_editor_bottom_toolbar_widgets[WIDX_NEXT_IMAGE].bottom - 1 + w->windowPos.y, w->colours[1],
INSET_RECT_F_30);
gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30);
}
int16_t stateX = (window_editor_bottom_toolbar_widgets[WIDX_PREVIOUS_IMAGE].right

View File

@ -1140,7 +1140,8 @@ static void window_editor_object_selection_scrollpaint(rct_window* w, rct_drawpi
{
// Draw checkbox
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && !(*listItem.flags & 0x20))
gfx_fill_rect_inset(dpi, 2, screenCoords.y, 11, screenCoords.y + 10, w->colours[1], INSET_RECT_F_E0);
gfx_fill_rect_inset(
dpi, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, w->colours[1], INSET_RECT_F_E0);
// Highlight background
auto highlighted = listItem.entry == w->object_entry && !(*listItem.flags & OBJECT_SELECTION_FLAG_6);

View File

@ -1083,7 +1083,7 @@ static void window_editor_objective_options_rides_scrollpaint(rct_window* w, rct
continue;
// Checkbox
gfx_fill_rect_inset(dpi, 2, y, 11, y + 10, w->colours[1], INSET_RECT_F_E0);
gfx_fill_rect_inset(dpi, { { 2, y }, { 11, y + 10 } }, w->colours[1], INSET_RECT_F_E0);
// Highlighted
auto stringId = STR_BLACK_STRING;

View File

@ -694,8 +694,6 @@ void gfx_draw_dashed_line(
// rect
void gfx_fill_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour);
void gfx_fill_rect_inset(
rct_drawpixelinfo* dpi, int16_t left, int16_t top, int16_t right, int16_t bottom, int32_t colour, uint8_t flags);
void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t colour, uint8_t flags);
void gfx_filter_rect(rct_drawpixelinfo* dpi, int32_t left, int32_t top, int32_t right, int32_t bottom, FilterPaletteID palette);
void gfx_filter_rect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPaletteID palette);

View File

@ -140,9 +140,3 @@ void gfx_fill_rect_inset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t
}
}
}
void gfx_fill_rect_inset(
rct_drawpixelinfo* dpi, int16_t left, int16_t top, int16_t right, int16_t bottom, int32_t colour, uint8_t flags)
{
gfx_fill_rect_inset(dpi, { left, top, right, bottom }, colour, flags);
}