diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 6dd726c93..1c59d2ad5 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -865,8 +865,7 @@ __declspec(noinline) void UIWindow::SetSize(int width, int height) { this->Slot16(); } -// OFFSET: 0x00A7BB60 -// FUNCTION: fn_16935 +// INLINED __declspec(noinline) void UIWindow::DrawBitmap(int x, int y, const BitmapImage* image, bool transparent) { if (!this->geometry.surface || !image) { return; @@ -876,6 +875,17 @@ __declspec(noinline) void UIWindow::DrawBitmap(int x, int y, const BitmapImage* this->geometry.surface->Copy(x, y, image->width, image->height, image->pixels, transparent); } +// OFFSET: 0x00A7BB60 +// FUNCTION: fn_16935 +__declspec(noinline) void UIWindow::DrawBitmap(int x, int y, CBitmapRes* bitmap, bool transparent) { + if (!this->geometry.surface || !bitmap) { + return; + } + + static_cast(this->geometry.surface)->SetAlpha(bitmap->image.alpha != 0); + this->geometry.surface->Copy(x, y, bitmap->image.width, bitmap->image.height, bitmap->image.pixels, transparent); +} + // OFFSET: 0x00A7BD60 // FUNCTION: fn_16938 __declspec(noinline) void UIWindow::FillRegion(int x, int y, int width, int height, std::uint32_t color) { diff --git a/Source/UI/Window/UIWindow.h b/Source/UI/Window/UIWindow.h index ab7977f64..7aec42add 100644 --- a/Source/UI/Window/UIWindow.h +++ b/Source/UI/Window/UIWindow.h @@ -120,6 +120,7 @@ public: void ClearSurface(std::uint32_t color); void SetSize(int width, int height); void DrawBitmap(int x, int y, const BitmapImage* image, bool transparent); + void DrawBitmap(int x, int y, CBitmapRes* bitmap, bool transparent); void DrawAlignedText(int x, int y, std::string text, int width, int align, std::uint32_t color, int arg7, int arg8, int arg9, int arg10, unsigned char bold); void FillRegion(int x, int y, int width, int height, std::uint32_t color); int TextWidth(const char* text, unsigned bytes, int family, int height, unsigned char bold, unsigned char italic);