//
// GJColorSetupLayer::updateSpriteColors from 0x10020bd30 to 0x10020beb2 (386 bytes)
//
// 6 xrefs:
// > GJColorSetupLayer::init @ 0x10020b967
// > GJColorSetupLayer::init @ 0x10020bc4a
// > GJColorSetupLayer::onPage @ 0x10020bf53
// > GJColorSetupLayer::showPage @ 0x10020c00c
// > GJColorSetupLayer::colorSelectClosed @ 0x10020c0c5
// > sub_10020C0D0 @ 0x10020c0dc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJColorSetupLayer::updateSpriteColors(GJColorSetupLayer *a1)
{
int v1; // r14d
unsigned int v2; // r15d
ColorChannelSprite *v3; // r12
__int64 v4; // r13
__int64 v5; // rax
int v6; // r14d
cocos2d::CCString *v7; // rax
const char *CString; // rax
ColorAction *ColorAction; // rsi
int v10; // [rsp+0h] [rbp-30h]
v1 = a1->m_page * a1->m_colorsPerPage;
if ( (unsigned int)sub_100720070(a1->m_colorSprites) )
{
v2 = 0;
LOBYTE(v10) = v1;
do
{
v3 = (ColorChannelSprite *)sub_1007200C0(a1->m_colorSprites, v2);
v4 = sub_1007200C0(a1->m_colorLabels, v2);
v5 = ((__int64 (__fastcall *)(ColorChannelSprite *))v3->getParent)(v3);
if ( (int)(v1 + v2) > 998 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 1040LL))(v5, 0);
((void (__fastcall *)(ColorChannelSprite *, _QWORD))v3->setVisible)(v3, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v4 + 328LL))(v4, 0);
}
else
{
v6 = v2 + v1 + 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 1040LL))(v5, 1);
((void (__fastcall *)(ColorChannelSprite *, __int64))v3->setVisible)(v3, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 328LL))(v4, 1);
v7 = (cocos2d::CCString *)sub_1007AB580("Col %i", v10);
CString = cocos2d::CCString::getCString(v7);
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v4 + 912LL))(v4, CString);
if ( GJEffectManager::colorExists(a1->m_settingsObject->m_effectManager, v6) )
ColorAction = GJEffectManager::getColorAction(a1->m_settingsObject->m_effectManager, v6);
else
ColorAction = nullptr;
ColorChannelSprite::updateValues(v3, ColorAction);
v1 = v10;
}
++v2;
}
while ( v2 < (unsigned int)sub_100720070(a1->m_colorSprites) );
}
}