From 36d0ed95ebbbde3d2282d14380f1af429f6eddfd Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 7 Nov 2026 06:48:55 +0000 Subject: [PATCH] Decompile fn_16947 (UIWindow::DrawActionSprite) Batch #13980 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_16947 UIWindow::DrawActionSprite: logic confirmed by peer review Peer-reviewed-by: secret, aDw, codeplay Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Window/UIWindow.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index c8872920c..252bb7b1f 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -1801,9 +1801,8 @@ int UIWindow::RestoreEditTexts(const unsigned char* data) { return offset; } -// OFFSET: 0x00A83FD0 -// FUNCTION: fn_17008 -bool UIWindow::FitSprite(const ActionFrame* frame, const CSprRes* sprite, int width, int height, int* x, int* y, float* scale) { +// INLINED +static __forceinline bool FitSpriteFrame(const ActionFrame* frame, const CSprRes* sprite, int width, int height, int* x, int* y, float* scale) { if (!width || !height || !frame || !sprite || !x || !y || !scale) { return false; } @@ -1884,6 +1883,16 @@ bool UIWindow::FitSprite(const ActionFrame* frame, const CSprRes* sprite, int wi return true; } +// OFFSET: 0x00A83FD0 +// FUNCTION: fn_17008 +bool UIWindow::FitSprite(const ActionFrame* frame, const CSprRes* sprite, int width, int height, int* x, int* y, float* scale) { + if (!FitSpriteFrame(frame, sprite, width, height, x, y, scale)) { + return false; + } + + return true; +} + // OFFSET: 0x005C27E0 // FUNCTION: fn_03535 UIListBox_NaviSearch::UIListBox_NaviSearch() : UIListBox() { @@ -3281,7 +3290,7 @@ void UIWindow::DrawActionSprite( int offsetX; int offsetY; float scale; - if (!this->FitSprite(&frames[0], sprite, width, height, &offsetX, &offsetY, &scale)) { + if (!FitSpriteFrame(&frames[0], sprite, width, height, &offsetX, &offsetY, &scale)) { return; }