From 32f5266595b9d3a237f3c4378ef772bab6e521ee Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 21:06:22 +0000 Subject: [PATCH] Decompile fn_14637 (CUIControl::IsPointInside) Batch #1168 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_14637 CUIControl::IsPointInside: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/UI/Window/UIControl.cpp | 10 ++++++++++ Source/UI/Window/UIControl.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Source/UI/Window/UIControl.cpp b/Source/UI/Window/UIControl.cpp index c0b3c179..72cabf89 100644 --- a/Source/UI/Window/UIControl.cpp +++ b/Source/UI/Window/UIControl.cpp @@ -1,5 +1,7 @@ #include "UI/Window/UIControl.h" +#include + // INLINED CUIControl::CUIControl(UIWindowContext& context) : UIWindow(context, 0), hitEnabled(1) { } @@ -101,6 +103,14 @@ void CUIControl::Slot35(int value) { } } +// OFFSET: 0x009EF5F0 +// FUNCTION: fn_14637 +bool CUIControl::IsPointInside(int x, int y) { + RECT rect = {this->geometry.x, this->geometry.y, this->geometry.x + this->geometry.width, this->geometry.y + this->geometry.height}; + POINT point = {x, y}; + return PtInRect(&rect, point) != FALSE; +} + // OFFSET: 0x009EF5E0 // FUNCTION: fn_14636 void CUIControl::Invalidate() { diff --git a/Source/UI/Window/UIControl.h b/Source/UI/Window/UIControl.h index a35fbd13..0b04e459 100644 --- a/Source/UI/Window/UIControl.h +++ b/Source/UI/Window/UIControl.h @@ -23,6 +23,8 @@ public: void Slot52(int value) override; virtual void Slot53(int value); + bool IsPointInside(int x, int y); + /* 007C */ unsigned char hitEnabled; };