diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index 1de79a36e4..bd84dfb83d 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -323,7 +323,7 @@ void InGameConsole::Draw(RenderTarget& rt) const auto backgroundColour = ThemeGetColour(WindowClass::console, 0); Rect::fillInset( rt, { _consoleTopLeft, _consoleBottomRight }, backgroundColour, Rect::BorderStyle::outset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_NONE); + Rect::FillMode::none); Rect::fillInset( rt, { _consoleTopLeft + ScreenCoordsXY{ 1, 1 }, _consoleBottomRight - ScreenCoordsXY{ 1, 1 } }, backgroundColour, Rect::BorderStyle::inset); diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 65e07991c7..2b544c79de 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -211,7 +211,7 @@ namespace OpenRCT2::Ui if (static_cast(widget.image.GetIndex()) == -2) { // Draw border with no fill - Rect::fillInset(rt, rect, colour, borderStyle, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + Rect::fillInset(rt, rect, colour, borderStyle, Rect::FillBrightness::light, Rect::FillMode::none); return; } @@ -298,8 +298,7 @@ namespace OpenRCT2::Ui if (static_cast(widget.image.GetIndex()) == -2) { // Draw border with no fill - Rect::fillInset( - rt, rect, colour, Rect::BorderStyle::inset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + Rect::fillInset(rt, rect, colour, Rect::BorderStyle::inset, Rect::FillBrightness::light, Rect::FillMode::none); return; } @@ -451,7 +450,7 @@ namespace OpenRCT2::Ui auto colour = w.colours[widget.colour]; Rect::fillInset( - rt, rect, colour, Rect::BorderStyle::inset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + rt, rect, colour, Rect::BorderStyle::inset, Rect::FillBrightness::light, Rect::FillMode::dontLightenWhenInset); WidgetText(rt, w, widgetIndex); } @@ -550,7 +549,7 @@ namespace OpenRCT2::Ui brightness = Rect::FillBrightness::dark; Rect::fillInset( - rt, { topLeft, bottomRight }, colour, Rect::BorderStyle::inset, brightness, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + rt, { topLeft, bottomRight }, colour, Rect::BorderStyle::inset, brightness, Rect::FillMode::dontLightenWhenInset); // Black caption bars look slightly green, this fixes that if (colour.colour == COLOUR_BLACK) @@ -644,7 +643,7 @@ namespace OpenRCT2::Ui // checkbox Rect::fillInset( rt, { midLeft - ScreenCoordsXY{ 0, 5 }, midLeft + ScreenCoordsXY{ 9, 4 } }, colour, Rect::BorderStyle::inset, - Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillBrightness::light, Rect::FillMode::dontLightenWhenInset); if (widgetIsDisabled(w, widgetIndex)) { @@ -695,7 +694,7 @@ namespace OpenRCT2::Ui // Draw the border Rect::fillInset( rt, { topLeft, bottomRight }, colour, Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillMode::dontLightenWhenInset); // Inflate by -1 topLeft.x++; @@ -1146,7 +1145,7 @@ namespace OpenRCT2::Ui // Rect::fillInset(rt, l, t, r, b, colour, 0x20 | (!active ? 0x40 : 0x00)); Rect::fillInset( rt, { topLeft, bottomRight }, w.colours[widget.colour], Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillMode::dontLightenWhenInset); // Figure out where the text should be positioned vertically. topLeft.y = w.windowPos.y + widget.textTop(); @@ -1212,7 +1211,7 @@ namespace OpenRCT2::Ui Rect::fillInset( rt, { topLeft, bottomRight }, w.colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_NONE); + Rect::FillMode::none); if (isBlinking) { if (GameIsNotPaused() && (gCurrentRealTimeTicks & 8)) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index b04ba9606e..dce99ac3b9 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -1053,7 +1053,7 @@ namespace OpenRCT2::Ui::Windows { Rect::fillInset( rt, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, { COLOUR_WHITE }, - Rect::BorderStyle::outset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + Rect::BorderStyle::outset, Rect::FillBrightness::light, Rect::FillMode::none); } } diff --git a/src/openrct2-ui/scripting/ScGraphicsContext.hpp b/src/openrct2-ui/scripting/ScGraphicsContext.hpp index 623158f845..73a839d269 100644 --- a/src/openrct2-ui/scripting/ScGraphicsContext.hpp +++ b/src/openrct2-ui/scripting/ScGraphicsContext.hpp @@ -173,7 +173,7 @@ namespace OpenRCT2::Scripting { Rect::fillInset( _rt, { x, y, x + width - 1, y + height - 1 }, { _colour.value_or(0) }, Rect::BorderStyle::inset, - Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillBrightness::light, Rect::FillMode::dontLightenWhenInset); } void clear() diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index c75dfba49d..c730f3c13f 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -261,7 +261,8 @@ namespace OpenRCT2::Ui::Windows void PaintCheckbox(RenderTarget& rt, const ScreenRect& rect, bool checked) { Rect::fillInset( - rt, rect, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::dark, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + rt, rect, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::dark, + Rect::FillMode::dontLightenWhenInset); if (checked) { auto checkmark = Formatter(); diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 14f22f7087..80ddc778da 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -350,7 +350,7 @@ namespace OpenRCT2::Ui::Windows + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].right - 1, widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 }; Rect::fillInset( rt, { topLeft, bottomRight }, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_NONE); + Rect::FillMode::none); GfxDrawSprite( rt, ImageId(SPR_PREVIOUS), @@ -390,7 +390,7 @@ namespace OpenRCT2::Ui::Windows + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 1, widgets[WIDX_NEXT_IMAGE].bottom - 1 }; Rect::fillInset( rt, { topLeft, bottomRight }, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_NONE); + Rect::FillMode::none); GfxDrawSprite( rt, ImageId(SPR_NEXT), diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 5847ce00a7..f23159e13e 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -744,7 +744,7 @@ namespace OpenRCT2::Ui::Windows if (!(gLegacyScene == LegacyScene::trackDesignsManager) && !(*listItem.flags & 0x20)) Rect::fillInset( rt, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], Rect::BorderStyle::inset, - Rect::FillBrightness::dark, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillBrightness::dark, Rect::FillMode::dontLightenWhenInset); // Highlight background auto highlighted = i == static_cast(selectedListItem) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 9072b69fb5..5e8b284a37 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -2352,7 +2352,7 @@ namespace OpenRCT2::Ui::Windows // Checkbox Rect::fillInset( rt, { { 2, y }, { 11, y + 10 } }, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::dark, - INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillMode::dontLightenWhenInset); // Highlighted auto stringId = STR_BLACK_STRING; diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index be35cc8e62..547e570150 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -793,13 +793,13 @@ namespace OpenRCT2::Ui::Windows // Graph Rect::fillInset( - rt, _graphBounds, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + rt, _graphBounds, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, Rect::FillMode::none); // hide resize widget on graph area constexpr ScreenCoordsXY offset{ 1, 1 }; constexpr ScreenCoordsXY bigOffset{ 5, 5 }; Rect::fillInset( rt, { _graphBounds.Point2 - bigOffset, _graphBounds.Point2 - offset }, colours[1], Rect::BorderStyle::none, - Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillBrightness::light, Rect::FillMode::dontLightenWhenInset); Graph::DrawFinanceGraph(rt, _graphProps); } diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 75bce00f08..c40637a2d7 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -97,7 +97,7 @@ namespace OpenRCT2::Ui::Windows // Draw green inset rectangle on panel Rect::fillInset( rt, { topLeft, bottomRight }, colours[0], Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_NONE); + Rect::FillMode::none); // Figure out how much line height we have to work with. uint32_t line_height = FontGetLineHeight(FontStyle::Medium); @@ -158,7 +158,7 @@ namespace OpenRCT2::Ui::Windows int16_t bar_width = (factor * 114) / 255; Rect::fillInset( rt, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, colours[0], - Rect::BorderStyle::inset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + Rect::BorderStyle::inset, Rect::FillBrightness::light, Rect::FillMode::none); if (!(colour & kBarBlink) || GameIsPaused() || (gCurrentRealTimeTicks & 8)) { if (bar_width > 2) @@ -183,7 +183,7 @@ namespace OpenRCT2::Ui::Windows // Draw green inset rectangle on panel Rect::fillInset( rt, { topLeft, bottomRight }, colours[0], Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_NONE); + Rect::FillMode::none); auto screenCoords = ScreenCoordsXY{ (rightPanelWidget.left + rightPanelWidget.right) / 2 + windowPos.x, rightPanelWidget.top + windowPos.y + 2 }; @@ -247,7 +247,7 @@ namespace OpenRCT2::Ui::Windows { windowPos + ScreenCoordsXY{ middleOutsetWidget.left + 1, middleOutsetWidget.top + 1 }, windowPos + ScreenCoordsXY{ middleOutsetWidget.right - 1, middleOutsetWidget.bottom - 1 } }, - colours[2], Rect::BorderStyle::inset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + colours[2], Rect::BorderStyle::inset, Rect::FillBrightness::light, Rect::FillMode::none); // Text auto screenCoords = windowPos + ScreenCoordsXY{ middleOutsetWidget.midX(), middleOutsetWidget.top + 11 }; @@ -360,7 +360,7 @@ namespace OpenRCT2::Ui::Windows rt, { windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 }, windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } }, - colours[0], Rect::BorderStyle::inset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + colours[0], Rect::BorderStyle::inset, Rect::FillBrightness::light, Rect::FillMode::none); // Figure out how much line height we have to work with. uint32_t line_height = FontGetLineHeight(FontStyle::Medium); diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index acbddfbb28..5375278770 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -446,7 +446,7 @@ namespace OpenRCT2::Ui::Windows { Rect::fillInset( rt, { frameStartPos, frameEndPos }, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::dark, - INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillMode::dontLightenWhenInset); } // Draw image, or placeholder if no preview was found diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 50fc7e3244..bb41f0c5c7 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -467,7 +467,7 @@ namespace OpenRCT2::Ui::Windows // Outer frame Rect::fillInset( rt, { -1, y, 383 + scrollbarFill, y + itemHeight - 1 }, colours[1], Rect::BorderStyle::inset, - Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + Rect::FillBrightness::light, Rect::FillMode::none); // Background Rect::fill(rt, { 0, y + 1, 381 + scrollbarFill, y + itemHeight - 2 }, backgroundPaletteIndex); diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 1a3099417f..3d0c35214b 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -715,13 +715,13 @@ namespace OpenRCT2::Ui::Windows // Graph border Rect::fillInset( rt, _ratingGraphBounds, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_NONE); + Rect::FillMode::none); // hide resize widget on graph area constexpr ScreenCoordsXY offset{ 1, 1 }; constexpr ScreenCoordsXY bigOffset{ 5, 5 }; Rect::fillInset( rt, { _ratingGraphBounds.Point2 - bigOffset, _ratingGraphBounds.Point2 - offset }, colours[1], - Rect::BorderStyle::none, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::BorderStyle::none, Rect::FillBrightness::light, Rect::FillMode::dontLightenWhenInset); Graph::DrawRatingGraph(rt, _ratingProps); } @@ -795,14 +795,13 @@ namespace OpenRCT2::Ui::Windows // Graph border Rect::fillInset( - rt, _guestGraphBounds, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, - INSET_RECT_FLAG_FILL_NONE); + rt, _guestGraphBounds, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, Rect::FillMode::none); // hide resize widget on graph area constexpr ScreenCoordsXY offset{ 1, 1 }; constexpr ScreenCoordsXY bigOffset{ 5, 5 }; Rect::fillInset( rt, { _guestGraphBounds.Point2 - bigOffset, _guestGraphBounds.Point2 - offset }, colours[1], - Rect::BorderStyle::none, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::BorderStyle::none, Rect::FillBrightness::light, Rect::FillMode::dontLightenWhenInset); Graph::DrawGuestGraph(rt, _guestProps); } diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index b00d6dd195..403c8244dd 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -292,7 +292,7 @@ namespace OpenRCT2::Ui::Windows auto frameEndPos = frameStartPos + ScreenCoordsXY(image->width + 1, image->height + 1); Rect::fillInset( rt, { frameStartPos, frameEndPos }, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::dark, - INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillMode::dontLightenWhenInset); // Draw image, if available auto imagePos = frameStartPos + ScreenCoordsXY(1, 1); diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 4823464656..3228219c3e 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -230,7 +230,7 @@ namespace OpenRCT2::Ui::Windows rt, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + kWindowSize.width - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } }, - colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::light, Rect::FillMode::dontLightenWhenInset); screenCoords.y += 1; diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 32c96b65af..b0a3b0349c 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -798,7 +798,7 @@ namespace OpenRCT2::Ui::Windows screenCoords.y + _check_offset_y + 11 + _button_size * j }; Rect::fillInset( rt, { topLeft, bottomRight }, colours[1], Rect::BorderStyle::inset, Rect::FillBrightness::dark, - INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillMode::dontLightenWhenInset); if (colour.hasFlag(ColourFlag::translucent)) { DrawText( diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 95a89b0803..8ab39cd4ce 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1640,7 +1640,7 @@ static uint64_t PageDisabledWidgets[] = { // Draw checkbox and check if visible Rect::fillInset( rt, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], Rect::BorderStyle::inset, - Rect::FillBrightness::dark, INSET_RECT_FLAG_FILL_DONT_LIGHTEN); + Rect::FillBrightness::dark, Rect::FillMode::dontLightenWhenInset); if (!tileElement->IsInvisible()) { auto eyeFormatter = Formatter(); diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 2ad9317c6a..54f5a96810 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -183,12 +183,6 @@ constexpr DrawBlendOp kBlendSrc = 1 << 1; */ constexpr DrawBlendOp kBlendDst = 2 << 2; -enum -{ - INSET_RECT_FLAG_FILL_NONE = (1 << 4), // 0x10 - INSET_RECT_FLAG_FILL_DONT_LIGHTEN = (1 << 6), // 0x40 -}; - enum class FilterPaletteID : int32_t { paletteNull = 0, diff --git a/src/openrct2/drawing/Rect.cpp b/src/openrct2/drawing/Rect.cpp index 809292f775..c21ab29f3e 100644 --- a/src/openrct2/drawing/Rect.cpp +++ b/src/openrct2/drawing/Rect.cpp @@ -43,7 +43,7 @@ namespace OpenRCT2::Drawing::Rect */ void fillInset( RenderTarget& rt, const ScreenRect& rect, ColourWithFlags colour, BorderStyle borderStyle, FillBrightness brightness, - uint8_t flags) + FillMode fillMode) { const auto leftTop = ScreenCoordsXY{ rect.GetLeft(), rect.GetTop() }; const auto leftBottom = ScreenCoordsXY{ rect.GetLeft(), rect.GetBottom() }; @@ -66,7 +66,7 @@ namespace OpenRCT2::Drawing::Rect Rect::filter(rt, { rightTop, rightBottom }, palette.shadow); Rect::filter(rt, { leftBottom, rightBottom }, palette.shadow); - if (!(flags & INSET_RECT_FLAG_FILL_NONE)) + if (fillMode != FillMode::none) { Rect::filter( rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, palette.base); @@ -80,7 +80,7 @@ namespace OpenRCT2::Drawing::Rect Rect::filter(rt, { rightTop, rightBottom }, palette.highlight); Rect::filter(rt, { leftBottom, rightBottom }, palette.highlight); - if (!(flags & INSET_RECT_FLAG_FILL_NONE)) + if (fillMode != FillMode::none) { Rect::filter( rt, { leftTop + ScreenCoordsXY{ 1, 1 }, { rightBottom - ScreenCoordsXY{ 1, 1 } } }, palette.base); @@ -117,9 +117,9 @@ namespace OpenRCT2::Drawing::Rect Rect::fill(rt, { rightTop + ScreenCoordsXY{ 0, 1 }, rightBottom - ScreenCoordsXY{ 0, 1 } }, hilight); Rect::fill(rt, { leftBottom + ScreenCoordsXY{ 1, 0 }, rightBottom }, hilight); - if (!(flags & INSET_RECT_FLAG_FILL_NONE)) + if (fillMode != FillMode::none) { - if (!(flags & INSET_RECT_FLAG_FILL_DONT_LIGHTEN)) + if (fillMode != FillMode::dontLightenWhenInset) { fill = ColourMapA[colour.colour].lighter; } @@ -134,7 +134,7 @@ namespace OpenRCT2::Drawing::Rect Rect::fill(rt, { rightTop, rightBottom - ScreenCoordsXY{ 0, 1 } }, shadow); Rect::fill(rt, { leftBottom, rightBottom }, shadow); - if (!(flags & INSET_RECT_FLAG_FILL_NONE)) + if (fillMode != FillMode::none) { Rect::fill(rt, { leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, fill); } diff --git a/src/openrct2/drawing/Rect.h b/src/openrct2/drawing/Rect.h index 1971c2af96..a201767bb1 100644 --- a/src/openrct2/drawing/Rect.h +++ b/src/openrct2/drawing/Rect.h @@ -29,10 +29,16 @@ namespace OpenRCT2::Drawing::Rect light, dark, }; + enum class FillMode : uint8_t + { + standard, + none, + dontLightenWhenInset, + }; void fill(RenderTarget& rt, const ScreenRect& rect, int32_t colour); void fillInset( RenderTarget& rt, const ScreenRect& rect, ColourWithFlags colour, BorderStyle borderStyle = BorderStyle::outset, - FillBrightness brightness = FillBrightness::light, uint8_t flags = 0); + FillBrightness brightness = FillBrightness::light, FillMode fillMode = FillMode::standard); void filter(RenderTarget& rt, const ScreenRect& rect, FilterPaletteID palette); } // namespace OpenRCT2::Drawing::Rect diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 70ac061f24..fcb1a86d59 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -145,7 +145,7 @@ void ChatDraw(RenderTarget& rt, ColourWithFlags chatBackgroundColor) FilterPaletteID::palette51); // Opaque grey background Rect::fillInset( rt, { topLeft - ScreenCoordsXY{ 0, 5 }, bottomRight + ScreenCoordsXY{ 0, 5 } }, chatBackgroundColor, - Rect::BorderStyle::outset, Rect::FillBrightness::light, INSET_RECT_FLAG_FILL_NONE); + Rect::BorderStyle::outset, Rect::FillBrightness::light, Rect::FillMode::none); Rect::fillInset( rt, { topLeft + ScreenCoordsXY{ 1, -4 }, bottomRight - ScreenCoordsXY{ 1, inputLineHeight + 6 } }, chatBackgroundColor, Rect::BorderStyle::inset);