//
// CustomizeObjectLayer::updateColorSprite from 0x1000589d8 to 0x100058aa8 (208 bytes)
//
// 9 xrefs:
// > CustomizeObjectLayer::onSelectMode @ 0x100057e98
// > CustomizeObjectLayer::onSelectColor @ 0x1000582d4
// > CustomizeObjectLayer::onUpdateCustomColor @ 0x100058368
// > CustomizeObjectLayer::onNextColorChannel @ 0x1000587b8
// > CustomizeObjectLayer::onPaste @ 0x10005882c
// > CustomizeObjectLayer::colorSetupClosed @ 0x100058cfc
// > CustomizeObjectLayer::colorSelectClosed @ 0x100058fc4
// > sub_100058FC8 @ 0x100058fcc
// > CustomizeObjectLayer::textChanged @ 0x10005944c
//
// 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::updateColorSprite(__int64 a1)
{
unsigned int v2; // w8
__int64 ActiveMode; // x0
int v4; // w20
__int64 v5; // x0
_BOOL8 v6; // x0
__int64 v7; // x0
double v8; // d0
double v9; // d1
_WORD *v10; // x1
LOBYTE(v2) = 1;
if ( *(_DWORD *)(a1 + 744) != 3 )
{
ActiveMode = CustomizeObjectLayer::getActiveMode(a1, 1);
v4 = ActiveMode;
if ( (int)ActiveMode >= 1
&& (v5 = GameManager::sharedState(ActiveMode),
v6 = sub_100010050(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v5 + 552) + 3272LL) + 320LL), v4)) )
{
v7 = GameManager::sharedState(v6);
v10 = sub_10000F52C(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v7 + 552) + 3272LL) + 320LL), v4, v8, v9);
}
else
{
v10 = nullptr;
}
ColorChannelSprite::updateValues(*(_QWORD *)(a1 + 896), (__int64)v10);
if ( (unsigned int)(v4 - 1005) <= 7 )
v2 = (v4 < 1) | (0xE7u >> (v4 + 19));
else
LOBYTE(v2) = v4 < 1;
}
return (*(__int64 (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 904) + 344LL))(
*(_QWORD *)(a1 + 904),
(v2 & 1) == 0);
}