From b8f9ee24d106c44edf23360e6fd176af93641a2f Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 03:57:12 +0000 Subject: [PATCH] Decompile 3 functions in Source/UI/UIStaticBitmap.cpp Batch #11622 by cremane: 2 byte-identical, 1 confirmed by peer review. - fn_10930 UIStaticBitmap::SetBitmap: byte-identical - fn_10817 UIStaticBitmap::Paint: logic confirmed by peer review - fn_10865 UIStaticBitmap::Slot28: byte-identical Peer-reviewed-by: Yommy, KWDev Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/UIStaticBitmap.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Source/UI/UIStaticBitmap.cpp b/Source/UI/UIStaticBitmap.cpp index a00934f3..51ad85aa 100644 --- a/Source/UI/UIStaticBitmap.cpp +++ b/Source/UI/UIStaticBitmap.cpp @@ -1,4 +1,4 @@ -#include "UI/Window/UINewSelectCharWnd.h" +#include "Resource/TextureNames.h" #include "Render/DeviceContext/DeviceContext.h" #include "Resource/Bitmap/BitmapResource.h" #include "Resource/ResourceMgr.h" @@ -19,7 +19,7 @@ UIStaticBitmap::~UIStaticBitmap() = default; // FUNCTION: fn_10930 void UIStaticBitmap::SetBitmap(const char* name) { this->bitmap = name; - const auto* resource = static_cast(ResourceMgr::Instance().Load(this->bitmap.c_str())); + const auto* resource = static_cast(ResourceMgr::Instance().Load(Resolve(this->bitmap.c_str()))); this->geometry.width = resource->image.width; this->geometry.height = resource->image.height; } @@ -39,11 +39,13 @@ void UIStaticBitmap::Paint() { return; } - if (this->geometry.unknown_0030 == 0) { - const auto* resource = static_cast(ResourceMgr::Instance().Load(this->bitmap.c_str())); - this->DrawBitmap(0, 0, resource ? &resource->image : nullptr, false); - } else if (this->geometry.unknown_0030 == 1 && this->geometry.surface) { - this->geometry.surface->Fill(nullptr, 0xFFFF00FFu); + switch (this->geometry.unknown_0030) { + case 0: + this->DrawBitmap(0, 0, &static_cast(ResourceMgr::Instance().Load(Resolve(this->bitmap.c_str())))->image, false); + break; + case 1: + this->ClearSurface(0xFFFF00FFu); + break; } } @@ -75,12 +77,7 @@ void UIStaticBitmap::Slot28(int x, int y) { if (!this->tooltip.empty()) { int screenX = this->tooltipX; int screenY = this->tooltipY; - - for (const UIWindow* window = this; window; window = window->parent) { - screenX = (screenX + window->geometry.x); - screenY = (screenY + window->geometry.y); - } - + this->ToScreen(screenX, screenY); g_modeMgr.gameMode->ShowTooltip(this->tooltip.c_str(), screenX, screenY, -1, false, true); } }