From d8af7ca0067eda9fffe5dc9ba5f6ce0025d441cc Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 15:20:30 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/WindowTitlebar.cpp Batch #12340 by cremane: 0 byte-identical, 2 confirmed by peer review. - fn_12098 UIWindow::DrawTitleBar: logic confirmed by peer review - fn_12099 UIWindow::DrawTitleBarAt: logic confirmed by peer review Peer-reviewed-by: Yommy, dori, codeplay Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/WindowTitlebar.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/UI/WindowTitlebar.cpp b/Source/UI/WindowTitlebar.cpp index de3353d8..530e5e35 100644 --- a/Source/UI/WindowTitlebar.cpp +++ b/Source/UI/WindowTitlebar.cpp @@ -27,13 +27,14 @@ int UIWindow::DrawTitleBar(bool closeButton, const char* title, int width) { auto* middle = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\titlebar_mid.bmp"))); if (middle) { + const int middleWidth = middle->image.width; titleHeight = middle->image.height; const int extent = width - right - left; - const int count = extent / middle->image.width + (extent % middle->image.width != 0); + const int count = extent / middleWidth + (extent % middleWidth != 0); for (int index = 0; index < count; ++index) { this->DrawBitmap(left, 0, &middle->image, false); - left += middle->image.width; + left += middleWidth; } } @@ -72,12 +73,14 @@ int UIWindow::DrawTitleBarAt(int x, int width, bool closeButton, const char* tit auto* middle = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\titlebar_mid.bmp"))); if (middle) { + const int middleWidth = middle->image.width; titleHeight = middle->image.height; const int extent = width - right - left; - const int count = extent / middle->image.width + (extent % middle->image.width != 0); + const int count = extent / middleWidth + (extent % middleWidth != 0); for (int index = 0; index < count; ++index) { - this->DrawBitmap(x + left + index * middle->image.width, 0, &middle->image, false); + this->DrawBitmap(x + left, 0, &middle->image, false); + left += middleWidth; } }