//
// CustomizeObjectLayer::updateSelected from 0x1000504f8 to 0x10005060c (276 bytes)
//
// 5 xrefs:
// > CustomizeObjectLayer::onSelectColor @ 0x10004fa94
// > CustomizeObjectLayer::onUpdateCustomColor @ 0x10004fb40
// > CustomizeObjectLayer::onNextColorChannel @ 0x10004ff7c
// > CustomizeObjectLayer::colorSetupClosed @ 0x100050498
// > CustomizeObjectLayer::textChanged @ 0x100050c28
//
// 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 CustomizeObjectLayer::updateSelected(CustomizeObjectLayer *a1, int a2)
{
GameObject *m_targetObject; // x0
GJSpriteColor *RelativeSpriteColor; // x0
int v6; // w8
cocos2d::CCArray *m_targetObjects; // x0
__int64 v8; // x21
int v9; // w24
GameObject *v10; // x22
GJSpriteColor *v11; // x0
int v12; // w8
int v13; // w9
int v14; // w9
m_targetObject = a1->m_targetObject;
if ( m_targetObject )
{
RelativeSpriteColor = GameObject::getRelativeSpriteColor(m_targetObject, a1->m_selectedMode);
if ( RelativeSpriteColor )
{
if ( a2 )
{
v6 = a2 & ~(a2 >> 31);
if ( v6 >= 1101 )
v6 = 1101;
}
else
{
v6 = 0;
v14 = RelativeSpriteColor->m_defaultColorID & ~(RelativeSpriteColor->m_defaultColorID >> 31);
if ( v14 >= 1101 )
v14 = 1101;
RelativeSpriteColor->m_defaultColorID = v14;
}
RelativeSpriteColor->m_colorID = v6;
a1->m_targetObject->m_updateParents = 1;
}
}
else
{
m_targetObjects = a1->m_targetObjects;
if ( m_targetObjects && (unsigned int)sub_10024A36C(m_targetObjects) )
{
v8 = 0;
if ( (a2 & ~(a2 >> 31)) >= 1101 )
v9 = 1101;
else
v9 = a2 & ~(a2 >> 31);
do
{
v10 = (GameObject *)sub_10024A388(a1->m_targetObjects, v8);
v11 = GameObject::getRelativeSpriteColor(v10, a1->m_selectedMode);
if ( v11 )
{
v12 = v9;
if ( !a2 )
{
v12 = 0;
v13 = v11->m_defaultColorID & ~(v11->m_defaultColorID >> 31);
if ( v13 >= 1101 )
v13 = 1101;
v11->m_defaultColorID = v13;
}
v11->m_colorID = v12;
v10->m_updateParents = 1;
}
v8 = (unsigned int)(v8 + 1);
}
while ( (unsigned int)v8 < (unsigned int)sub_10024A36C(a1->m_targetObjects) );
}
}
}