//
// GJColorSetupLayer::updateSpriteColors from 0x1001ef080 to 0x1001ef202 (386 bytes)
//
// 6 xrefs:
// > GJColorSetupLayer::init @ 0x1001eecb7
// > GJColorSetupLayer::init @ 0x1001eef9a
// > GJColorSetupLayer::onPage @ 0x1001ef2a3
// > GJColorSetupLayer::showPage @ 0x1001ef35c
// > GJColorSetupLayer::colorSelectClosed @ 0x1001ef415
// > sub_1001EF420 @ 0x1001ef42c
//
// 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:32 +0000
//
__int64 __fastcall GJColorSetupLayer::updateSpriteColors(__int64 a1, double a2)
{
int v2; // r14d
__int64 result; // rax
unsigned int v4; // r15d
__int64 v5; // r12
__int64 v6; // r13
__int64 v7; // rax
unsigned int v8; // r14d
__int64 v9; // rax
__int64 CString; // rax
__int64 ColorAction; // rsi
int v12; // [rsp+0h] [rbp-30h]
v2 = *(_DWORD *)(a1 + 720) * *(_DWORD *)(a1 + 724);
result = sub_1007FEF90(*(_QWORD *)(a1 + 712));
if ( (_DWORD)result )
{
v4 = 0;
LOBYTE(v12) = v2;
do
{
v5 = sub_1007FEFE0(*(_QWORD *)(a1 + 712), v4);
v6 = sub_1007FEFE0(*(_QWORD *)(a1 + 704), v4);
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 512LL))(v5);
if ( (int)(v2 + v4) > 998 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v7 + 1056LL))(v7, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 344LL))(v5, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 344LL))(v6, 0);
}
else
{
v8 = v4 + v2 + 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v7 + 1056LL))(v7, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 344LL))(v5, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v6 + 344LL))(v6, 1);
v9 = sub_10088E820("Col %i", v12);
CString = cocos2d::CCString::getCString(v9);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v6 + 928LL))(v6, CString);
if ( (unsigned __int8)GJEffectManager::colorExists(*(_QWORD *)(*(_QWORD *)(a1 + 680) + 320LL), v8) )
ColorAction = GJEffectManager::getColorAction(*(_QWORD *)(*(_QWORD *)(a1 + 680) + 320LL), v8);
else
ColorAction = 0;
ColorChannelSprite::updateValues(v5, ColorAction, a2);
v2 = v12;
}
++v4;
result = sub_1007FEF90(*(_QWORD *)(a1 + 712));
}
while ( v4 < (unsigned int)result );
}
return result;
}