1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00

Use dpi ref in rect and line drawing functions

This commit is contained in:
Gymnasiast
2023-04-03 23:16:34 +02:00
committed by duncanspumpkin
parent 2941f6f7a5
commit bb83a80eab
47 changed files with 276 additions and 278 deletions

View File

@@ -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;