//
// CustomizeObjectLayer::updateColorSprite from 0x1001daa20 to 0x1001daae5 (197 bytes)
//
// 9 xrefs:
// > CustomizeObjectLayer::onSelectMode @ 0x1001d99e5
// > CustomizeObjectLayer::onSelectColor @ 0x1001d9f67
// > CustomizeObjectLayer::onUpdateCustomColor @ 0x1001da03b
// > CustomizeObjectLayer::onNextColorChannel @ 0x1001da6e6
// > CustomizeObjectLayer::onPaste @ 0x1001da7b3
// > CustomizeObjectLayer::colorSetupClosed @ 0x1001dae86
// > CustomizeObjectLayer::colorSelectClosed @ 0x1001db255
// > sub_1001DB260 @ 0x1001db26c
// > CustomizeObjectLayer::textChanged @ 0x1001db92b
//
// This function is hookable on this platform (idp: pc, 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 12:26:26 +0000
//
__int64 __fastcall CustomizeObjectLayer::updateColorSprite(__int64 a1, double a2)
{
char v3; // al
__int64 v4; // rdx
int ActiveMode; // r14d
__int64 v6; // rax
__int64 v7; // rdi
__int64 v8; // rdx
__int64 v9; // rax
__int64 ColorAction; // rsi
v3 = 1;
if ( *(_DWORD *)(a1 + 744) != 3 )
{
ActiveMode = CustomizeObjectLayer::getActiveMode(a1, 1);
if ( ActiveMode > 0
&& (*(_QWORD *)&a2 = GameManager::sharedState(a1, 1, v4).u64[0],
v7 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v6 + 552) + 3272LL) + 320LL),
(unsigned __int8)GJEffectManager::colorExists(v7, (unsigned int)ActiveMode)) )
{
*(_QWORD *)&a2 = GameManager::sharedState(v7, (unsigned int)ActiveMode, v8).u64[0];
ColorAction = GJEffectManager::getColorAction(
*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v9 + 552) + 3272LL) + 320LL),
(unsigned int)ActiveMode);
}
else
{
ColorAction = 0;
}
ColorChannelSprite::updateValues(*(_QWORD *)(a1 + 896), ColorAction, a2);
v3 = ActiveMode <= 0;
if ( (unsigned int)(ActiveMode - 1005) <= 7 )
v3 = (ActiveMode <= 0) | (0xE7u >> (ActiveMode + 19));
}
return (*(__int64 (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 904) + 344LL))(
*(_QWORD *)(a1 + 904),
(v3 & 1) == 0);
}