//
// CustomizeObjectLayer::updateSelected from 0x57e7cc to 0x57e88e (194 bytes)
//
// 5 xrefs:
// > CustomizeObjectLayer::onSelectColor @ 0x57e968
// > CustomizeObjectLayer::colorSetupClosed @ 0x57eab6
// > CustomizeObjectLayer::onNextColorChannel @ 0x57eb4c
// > CustomizeObjectLayer::onUpdateCustomColor @ 0x57ee7a
// > CustomizeObjectLayer::textChanged @ 0x57f30e
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:52:51 +0000
//
int *__fastcall CustomizeObjectLayer::updateSelected(CustomizeObjectLayer *this, int a2)
{
int *result; // r0
_BOOL4 v5; // r7
int v6; // r6
int v7; // r3
int v8; // r3
int v9; // r6
unsigned int i; // r4
GameObject *v11; // r11
int *RelativeSpriteColor; // r0
int v13; // r3
int v14; // r3
result = *((int **)this + 133);
v5 = a2 == 0;
if ( result )
{
result = (int *)GameObject::getRelativeSpriteColor((GameObject *)result, *((_DWORD *)this + 140));
if ( result )
{
if ( v5 )
{
v7 = result[1];
if ( v7 > 1100 )
v8 = 1101;
else
v8 = v7 & ~(v7 >> 31);
result[1] = v8;
*result = 0;
}
else
{
if ( a2 > 1100 )
v6 = 1101;
else
v6 = a2 & ~(a2 >> 31);
*result = v6;
}
*(_BYTE *)(*((_DWORD *)this + 133) + 1004) = 1;
}
}
else if ( *((_DWORD *)this + 134) )
{
if ( a2 > 1100 )
v9 = 1101;
else
v9 = a2 & ~(a2 >> 31);
for ( i = 0; ; ++i )
{
result = (int *)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 134));
if ( i >= (unsigned int)result )
break;
v11 = (GameObject *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 134), i);
RelativeSpriteColor = (int *)GameObject::getRelativeSpriteColor(v11, *((_DWORD *)this + 140));
if ( RelativeSpriteColor )
{
if ( v5 )
{
v13 = RelativeSpriteColor[1];
*RelativeSpriteColor = 0;
if ( v13 > 1100 )
v14 = 1101;
else
v14 = v13 & ~(v13 >> 31);
RelativeSpriteColor[1] = v14;
}
else
{
*RelativeSpriteColor = v9;
}
*((_BYTE *)v11 + 1004) = 1;
}
}
}
return result;
}