mirror of https://github.com/OpenRCT2/OpenRCT2.git
Increase usage of gfx_fill_rect_inset that uses ScreenRect
This commit is contained in:
parent
d5b5c10e80
commit
aa88c8d181
|
@ -389,12 +389,14 @@ static void window_game_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* d
|
|||
|
||||
static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo* dpi, rct_window* w)
|
||||
{
|
||||
const auto topLeft = w->windowPos
|
||||
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left + 1,
|
||||
window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top + 1 };
|
||||
const auto bottomRight = w->windowPos
|
||||
+ 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
|
||||
gfx_fill_rect_inset(
|
||||
dpi, w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left + 1,
|
||||
w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top + 1,
|
||||
w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right - 1,
|
||||
w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom - 1, w->colours[1], INSET_RECT_F_30);
|
||||
gfx_fill_rect_inset(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 = font_get_line_height(FontSpriteBase::MEDIUM);
|
||||
|
@ -482,12 +484,14 @@ static void window_game_bottom_toolbar_draw_park_rating(
|
|||
|
||||
static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo* dpi, rct_window* w)
|
||||
{
|
||||
const auto topLeft = w->windowPos
|
||||
+ ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 1,
|
||||
window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + 1 };
|
||||
const auto bottomRight = w->windowPos
|
||||
+ 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
|
||||
gfx_fill_rect_inset(
|
||||
dpi, w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 1,
|
||||
w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + 1,
|
||||
w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right - 1,
|
||||
w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom - 1, w->colours[1], INSET_RECT_F_30);
|
||||
gfx_fill_rect_inset(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)
|
||||
|
@ -561,9 +565,10 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo* dpi, rc
|
|||
|
||||
// Current news item
|
||||
gfx_fill_rect_inset(
|
||||
dpi, w->windowPos.x + middleOutsetWidget->left + 1, w->windowPos.y + middleOutsetWidget->top + 1,
|
||||
w->windowPos.x + middleOutsetWidget->right - 1, w->windowPos.y + middleOutsetWidget->bottom - 1, w->colours[2],
|
||||
INSET_RECT_F_30);
|
||||
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);
|
||||
|
||||
// Text
|
||||
const auto* newsItemText = newsItem->Text.c_str();
|
||||
|
@ -650,9 +655,10 @@ static void window_game_bottom_toolbar_draw_middle_panel(rct_drawpixelinfo* dpi,
|
|||
rct_widget* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET];
|
||||
|
||||
gfx_fill_rect_inset(
|
||||
dpi, w->windowPos.x + middleOutsetWidget->left + 1, w->windowPos.y + middleOutsetWidget->top + 1,
|
||||
w->windowPos.x + middleOutsetWidget->right - 1, w->windowPos.y + middleOutsetWidget->bottom - 1, w->colours[1],
|
||||
INSET_RECT_F_30);
|
||||
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);
|
||||
|
||||
// Figure out how much line height we have to work with.
|
||||
uint32_t line_height = font_get_line_height(FontSpriteBase::MEDIUM);
|
||||
|
|
|
@ -1257,7 +1257,7 @@ static void window_guest_stats_bars_paint(
|
|||
y += 1;
|
||||
}
|
||||
|
||||
gfx_fill_rect_inset(dpi, x + 61, y + 1, x + 61 + 121, y + 9, w->colours[1], INSET_RECT_F_30);
|
||||
gfx_fill_rect_inset(dpi, { x + 61, y + 1, x + 61 + 121, y + 9 }, w->colours[1], INSET_RECT_F_30);
|
||||
|
||||
if (!blinkFlag || game_is_paused() || (gCurrentRealTimeTicks & 8) == 0)
|
||||
{
|
||||
|
@ -1267,7 +1267,7 @@ static void window_guest_stats_bars_paint(
|
|||
if (value <= 2)
|
||||
return;
|
||||
|
||||
gfx_fill_rect_inset(dpi, x + 63, y + 2, x + 63 + value - 1, y + 8, colour, 0);
|
||||
gfx_fill_rect_inset(dpi, { x + 63, y + 2, x + 63 + value - 1, y + 8 }, colour, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1377,7 +1377,7 @@ void window_guest_stats_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
|
||||
screenCoords.y += LIST_ROW_HEIGHT + 9;
|
||||
gfx_fill_rect_inset(
|
||||
dpi, screenCoords.x, screenCoords.y - 6, screenCoords.x + 179, screenCoords.y - 5, w->colours[1],
|
||||
dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, w->colours[1],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
// Preferred Ride
|
||||
|
@ -1664,7 +1664,7 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
}
|
||||
|
||||
gfx_fill_rect_inset(
|
||||
dpi, screenCoords.x, screenCoords.y - 6, screenCoords.x + 179, screenCoords.y - 5, w->colours[1],
|
||||
dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, w->colours[1],
|
||||
INSET_RECT_FLAG_BORDER_INSET);
|
||||
|
||||
// Paid to enter
|
||||
|
|
|
@ -855,7 +855,8 @@ static void window_multiplayer_groups_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
screenPos.y += 20;
|
||||
|
||||
gfx_fill_rect_inset(
|
||||
dpi, screenPos.x, screenPos.y - 6, screenPos.x + 310, screenPos.y - 5, w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
||||
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];
|
||||
group = network_get_group_index(_selectedGroup);
|
||||
|
|
|
@ -175,7 +175,7 @@ static void window_music_credits_scrollpaint(rct_window* w, rct_drawpixelinfo* d
|
|||
|
||||
// Draw the separator
|
||||
screenCoords.y += 5;
|
||||
gfx_fill_rect_inset(dpi, 4, screenCoords.y, 484, screenCoords.y + 1, w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
||||
gfx_fill_rect_inset(dpi, { 4, screenCoords.y, 484, screenCoords.y + 1 }, w->colours[1], INSET_RECT_FLAG_BORDER_INSET);
|
||||
screenCoords.y += lineHeight + 1;
|
||||
|
||||
for (size_t i = 0; i < std::size(music_credits_rct2); i++)
|
||||
|
|
Loading…
Reference in New Issue