From 8f922eff50898d6e83de3c0dd7ea151e4de7b38d Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 15:50:40 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/Layout/SnapMgr.cpp Batch #16272 by Yommy: 2 byte-identical, 0 confirmed by peer review. - fn_09706 CSnapMgr::ConstrainGroup: byte-identical - fn_09715 CSnapMgr::ConnectedToRoot: byte-identical (already on main) Merged automatically: every function is byte-identical to the original. --- Source/UI/Layout/SnapMgr.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Source/UI/Layout/SnapMgr.cpp b/Source/UI/Layout/SnapMgr.cpp index dcf9dc90c..754004ff8 100644 --- a/Source/UI/Layout/SnapMgr.cpp +++ b/Source/UI/Layout/SnapMgr.cpp @@ -4,6 +4,8 @@ #include "Render/Renderer.h" #include "UI/Window/UIWindowMgr.h" +#include + // STATIC: 0x01334698 // GLOBAL: gl_21916 const int g_snapOppositeSide[4] = {2, 3, 0, 1}; @@ -16,13 +18,6 @@ int g_snapDirection = 1; // GLOBAL: gl_24655 CSnapMgr g_snapMgr; -namespace { - // INLINED - int Magnitude(int value) { - return value < 0 ? (0 - value) : value; - } -} - // OFFSET: 0x007E2DB0 // FUNCTION: fn_09714 bool SnapObject::ContainsUpward(SnapObject* target) { @@ -63,8 +58,8 @@ SnapObject* CSnapMgr::Find(const UIWindow* window) const { // INLINED void CSnapMgr::ResetVisited() { - for (SnapObject* object : this->objects) { - object->visited = 0; + for (auto object = this->objects.begin(); object != this->objects.end(); ++object) { + (*object)->visited = 0; } } @@ -210,11 +205,11 @@ void CSnapMgr::ConstrainGroup(UIWindow* window, int& dx, int& dy) { g_windowMgr.ConstrainSnap(member, x, y, 1); member->geometry.x = savedY; - if (Magnitude(resultX) < Magnitude(x)) { + if (std::abs(resultX) < std::abs(x)) { resultX = x; } - if (Magnitude(resultY) < Magnitude(y)) { + if (std::abs(resultY) < std::abs(y)) { resultY = y; } }