//
// CustomizeObjectLayer::getActiveMode from 0x10005889c to 0x100058978 (220 bytes)
//
// 7 xrefs:
// > CustomizeObjectLayer::onSelectMode @ 0x100057ea4
// > CustomizeObjectLayer::onSelectColor @ 0x1000582e0
// > sub_100058414 @ 0x100058428
// > sub_100058468 @ 0x10005847c
// > CustomizeObjectLayer::onPaste @ 0x100058838
// > CustomizeObjectLayer::updateCurrentSelection @ 0x10005898c
// > CustomizeObjectLayer::updateColorSprite @ 0x100058a08
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:57:46 +0000
//
__int64 __fastcall CustomizeObjectLayer::getActiveMode(__int64 a1, char a2)
{
__int64 v4; // x0
__int64 result; // x0
unsigned int v6; // w8
char v7; // w21
__int64 v8; // x20
unsigned int v9; // w22
__int64 v10; // x0
unsigned int *RelativeSpriteColor; // x0
unsigned int v12; // w8
v4 = *(_QWORD *)(a1 + 688);
if ( v4 )
{
result = GameObject::getRelativeSpriteColor(v4, *(unsigned int *)(a1 + 744));
if ( result )
{
v6 = *(_DWORD *)(result + 4);
if ( *(_DWORD *)result )
result = *(unsigned int *)result;
else
result = v6;
if ( (a2 & 1) == 0 )
{
if ( v6 == (_DWORD)result )
return 0;
else
return (unsigned int)result;
}
}
}
else
{
v7 = a2 ^ 1;
if ( (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 696)) )
{
v8 = 0;
v9 = -1;
do
{
v10 = sub_1002E75A0(*(_QWORD *)(a1 + 696), v8);
RelativeSpriteColor = (unsigned int *)GameObject::getRelativeSpriteColor(v10, *(unsigned int *)(a1 + 744));
if ( RelativeSpriteColor )
{
v12 = *RelativeSpriteColor;
if ( !*RelativeSpriteColor )
v12 = RelativeSpriteColor[1];
v7 &= v12 == RelativeSpriteColor[1];
if ( v9 == -1 )
{
v9 = v12;
}
else if ( v9 != v12 )
{
goto LABEL_21;
}
}
v8 = (unsigned int)(v8 + 1);
}
while ( (unsigned int)v8 < (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 696)) );
}
else
{
LABEL_21:
v9 = -1;
}
if ( (v7 & 1) != 0 )
return 0;
else
return v9;
}
return result;
}