//
// CustomizeObjectLayer::updateSelected from 0x140143f00 to 0x140144065 (357 bytes)
//
// 8 xrefs:
// > CustomizeObjectLayer::colorSetupClosed @ 0x140142470
// > CustomizeObjectLayer::onNextColorChannel @ 0x140143081
// > CustomizeObjectLayer::onUpdateCustomColor @ 0x14014373e
// > CustomizeObjectLayer::textChanged @ 0x140143a8d
// > CustomizeObjectLayer::onSelectColor @ 0x140143e6b
// > ??> @ 0x140899f5c
// > ??> @ 0x140899f6c
// > ??> @ 0x140917468
//
// 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 11:27:10 +0000
//
void __fastcall CustomizeObjectLayer::updateSelected(__int64 a1, int a2)
{
__int64 v4; // rcx
__int64 RelativeSpriteColor; // rax
_DWORD *v6; // rcx
int v7; // ebx
int v8; // eax
cocos2d::CCArray *v9; // rcx
unsigned int v10; // ebp
struct cocos2d::CCObject *v11; // rax
__int64 v12; // rax
__int64 v13; // r10
_DWORD *v14; // r9
int v15; // ecx
int v16; // eax
v4 = *(_QWORD *)(a1 + 688);
if ( v4 )
{
RelativeSpriteColor = GameObject::getRelativeSpriteColor(v4, *(unsigned int *)(a1 + 744));
v6 = (_DWORD *)RelativeSpriteColor;
if ( RelativeSpriteColor )
{
v7 = 1101;
if ( a2 )
{
if ( a2 < 0 )
a2 = 0;
if ( a2 <= 1101 )
v7 = a2;
}
else
{
v8 = *(_DWORD *)(RelativeSpriteColor + 4);
if ( v8 < 0 )
v8 = 0;
if ( v8 <= 1101 )
v7 = v8;
v6[1] = v7;
v7 = 0;
}
*v6 = v7;
*(_BYTE *)(*(_QWORD *)(a1 + 688) + 1156LL) = 1;
}
}
else
{
v9 = *(cocos2d::CCArray **)(a1 + 696);
if ( v9 )
{
v10 = 0;
if ( cocos2d::CCArray::count(v9) )
{
do
{
v11 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 696), v10);
v12 = GameObject::getRelativeSpriteColor(v11, *(unsigned int *)(a1 + 744));
v14 = (_DWORD *)v12;
if ( v12 )
{
if ( a2 )
{
v15 = a2;
if ( a2 < 0 )
v15 = 0;
if ( v15 <= 1101 )
{
if ( v15 < 0 )
v15 = 1011;
}
else
{
v15 = 1101;
}
}
else
{
v16 = *(_DWORD *)(v12 + 4);
if ( v16 < 0 )
v16 = 0;
if ( v16 > 1101 )
v16 = 1101;
v14[1] = v16;
v15 = 0;
}
*v14 = v15;
*(_BYTE *)(v13 + 1156) = 1;
}
++v10;
}
while ( v10 < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 696)) );
}
}
}
}