Move GfxFilterPixel to Rectangle.cpp

This commit is contained in:
Gymnasiast committed 2026-09-06 20:03:24 +02:00
1 parent 96ba41b5e6
commit fcdf61e009
5 files changed
+11 -12

No files matched your search

+4 -5
View File
@@ -14,7 +14,6 @@
#include <openrct2/Context.h>
#include <openrct2/Input.h>
#include <openrct2/drawing/Drawing.String.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Font.h>
#include <openrct2/drawing/Rectangle.h>
#include <openrct2/localisation/Formatter.h>
@@ -125,10 +124,10 @@ namespace OpenRCT2::Ui::Windows
Rectangle::filter(rt, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::paletteDarken3);
// Corners
GfxFilterPixel(rt, { left + 1, top + 1 }, FilterPaletteID::paletteDarken3);
GfxFilterPixel(rt, { right - 1, top + 1 }, FilterPaletteID::paletteDarken3);
GfxFilterPixel(rt, { left + 1, bottom - 1 }, FilterPaletteID::paletteDarken3);
GfxFilterPixel(rt, { right - 1, bottom - 1 }, FilterPaletteID::paletteDarken3);
Rectangle::filterPixel(rt, { left + 1, top + 1 }, FilterPaletteID::paletteDarken3);
Rectangle::filterPixel(rt, { right - 1, top + 1 }, FilterPaletteID::paletteDarken3);
Rectangle::filterPixel(rt, { left + 1, bottom - 1 }, FilterPaletteID::paletteDarken3);
Rectangle::filterPixel(rt, { right - 1, bottom - 1 }, FilterPaletteID::paletteDarken3);
// Text
left = windowPos.x + ((width + 1) / 2) - 1;
-5
View File
@@ -374,11 +374,6 @@ const TranslucentWindowPalette kTranslucentWindowPalettes[kColourNumTotal] = {
};
// clang-format on
void GfxFilterPixel(RenderTarget& rt, const ScreenCoordsXY& coords, FilterPaletteID palette)
{
Rectangle::filter(rt, { coords, coords }, palette);
}
/*
*
* rct2: 0x006EE53B
-2
View File
@@ -51,8 +51,6 @@ bool ClipRenderTarget(
// other
void GfxClear(OpenRCT2::Drawing::RenderTarget& rt, OpenRCT2::Drawing::PaletteIndex paletteIndex);
void GfxFilterPixel(
OpenRCT2::Drawing::RenderTarget& rt, const ScreenCoordsXY& coords, OpenRCT2::Drawing::FilterPaletteID palette);
// sprite (NewDrawing.cpp functions that use the drawing engine)
void FASTCALL GfxDrawSprite(OpenRCT2::Drawing::RenderTarget& rt, ImageId image_id, const ScreenCoordsXY& coords);
+5
View File
@@ -153,4 +153,9 @@ namespace OpenRCT2::Drawing::Rectangle
dc->FilterRect(rt, palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom());
}
}
void filterPixel(RenderTarget& rt, const ScreenCoordsXY& coords, FilterPaletteID palette)
{
filter(rt, { coords, coords }, palette);
}
} // namespace OpenRCT2::Drawing::Rectangle
+2
View File
@@ -11,6 +11,7 @@
#include <cstdint>
struct ScreenCoordsXY;
struct ScreenRect;
namespace OpenRCT2
@@ -51,4 +52,5 @@ namespace OpenRCT2::Drawing::Rectangle
RenderTarget& rt, const ScreenRect& rect, ColourWithFlags colour, BorderStyle borderStyle = BorderStyle::outset,
FillBrightness brightness = FillBrightness::light, FillMode fillMode = FillMode::standard);
void filter(RenderTarget& rt, const ScreenRect& rect, FilterPaletteID palette);
void filterPixel(RenderTarget& rt, const ScreenCoordsXY& coords, FilterPaletteID palette);
} // namespace OpenRCT2::Drawing::Rectangle