From 2c9f3270f943d551325d3b6c4dd41941b406c283 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 21:09:35 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/MiniPartyPlacement.cpp, Source/UI/MiniPartyPlacement.h Batch #1206 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_07650 CMiniPartyWndSortArea::CMiniPartyWndSortArea: logic confirmed by peer review - fn_07658 CMiniPartyWndSortArea::GetCells: logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/UI/MiniPartyPlacement.cpp --- Source/UI/MiniPartyPlacement.cpp | 28 ++++++++++++++++++++++++++++ Source/UI/MiniPartyPlacement.h | 27 +++++++++++++++++++++++++++ data/compile.json | 1 + 3 files changed, 56 insertions(+) create mode 100644 Source/UI/MiniPartyPlacement.cpp create mode 100644 Source/UI/MiniPartyPlacement.h diff --git a/Source/UI/MiniPartyPlacement.cpp b/Source/UI/MiniPartyPlacement.cpp new file mode 100644 index 0000000..d885fe7 --- /dev/null +++ b/Source/UI/MiniPartyPlacement.cpp @@ -0,0 +1,28 @@ +#include "UI/MiniPartyPlacement.h" +#include "UI/MiniPartyGrid.h" +#include "UI/Window/UIWindowMgr.h" + +// OFFSET: 0x00737680 +// FUNCTION: fn_07650 +CMiniPartyWndSortArea::CMiniPartyWndSortArea(const RECT& bounds) { + SetRect(&this->area, 0, 0, g_windowMgr.unknown_047C, g_windowMgr.unknown_0480); + this->columns = (this->area.right - this->area.left) / g_miniPartyCellWidth; + this->rows = (this->area.bottom - this->area.top) / g_miniPartyCellHeight; + + const RECT target = bounds; + + for (int index = 0; index < this->columns * this->rows; ++index) { + const int x = this->area.left + g_miniPartyCellWidth * (index / this->rows); + const int y = this->area.top + g_miniPartyCellHeight * (index % this->rows); + + if (target.left <= x && x + g_miniPartyCellWidth <= target.right && target.top <= y && y + g_miniPartyCellHeight <= target.bottom) { + this->cells.push_back(index); + } + } +} + +// OFFSET: 0x00737D40 +// FUNCTION: fn_07658 +std::list CMiniPartyWndSortArea::GetCells() const { + return this->cells; +} diff --git a/Source/UI/MiniPartyPlacement.h b/Source/UI/MiniPartyPlacement.h new file mode 100644 index 0000000..43fcb90 --- /dev/null +++ b/Source/UI/MiniPartyPlacement.h @@ -0,0 +1,27 @@ +#ifndef RAGNAROK_SOURCE_UI_MINIPARTYPLACEMENT_H +#define RAGNAROK_SOURCE_UI_MINIPARTYPLACEMENT_H + +#include +#include +#include + +class CMiniPartyWndSortArea { +public: + /* 0004 */ RECT area; + /* 0014 */ int columns; + /* 0018 */ int rows; + /* 001C */ std::list cells; + + virtual ~CMiniPartyWndSortArea() = default; + + explicit CMiniPartyWndSortArea(const RECT& bounds); + std::list GetCells() const; +}; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(CMiniPartyWndSortArea, area) == 0x04); +static_assert(offsetof(CMiniPartyWndSortArea, cells) == 0x1C); +static_assert(sizeof(CMiniPartyWndSortArea) == 0x24); +#endif + +#endif diff --git a/data/compile.json b/data/compile.json index 806034a..7ea22e3 100644 --- a/data/compile.json +++ b/data/compile.json @@ -568,6 +568,7 @@ "Source/UI/Lists/UIScrollBar.cpp": 2, "Source/UI/Lists/UIScrollBarNavi.cpp": 2, "Source/UI/MiniPartyGrid.cpp": 2, + "Source/UI/MiniPartyPlacement.cpp": 2, "Source/UI/Party/UIAdvenPartyBoardWnd.cpp": 2, "Source/UI/Party/UIApplyForPartyWnd.cpp": 2, "Source/UI/Party/UIPartyInfoWnd.cpp": 2,