//
// GJEffectManager::processInheritedColors from 0x10000f3bc to 0x10000f59c (480 bytes)
//
// 3 xrefs:
// > GJEffectManager::processColors @ 0x10000f258
// > GJEffectManager::loadFromState @ 0x1000171b4
// > PlayLayer::loadDefaultColors @ 0x1001187f4
//
// 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 GJEffectManager::processInheritedColors(GJEffectManager *a1)
{
cocos2d::CCDictionary *m_unkDict268; // x8
cocos2d::CCDictElement *m_pElements; // x9
cocos2d::CCObject *m_pObject; // x11
cocos2d::CCDictionary *m_colorActionDict; // x9
cocos2d::CCDictElement *next; // x24
ColorAction *v7; // x27
int v8; // w8
intptr_t v9; // x22
int m_colorID; // w8
unsigned int v11; // w9
intptr_t v12; // x20
InheritanceNode *m_inheritanceNode; // x21
std::__vector_base::pointer begin; // x8
InheritanceNode *v15; // x23
int v16; // w9
InheritanceNode *v17; // x8
cocos2d::CCDictElement *v18; // x20
InheritanceNode *v19; // x1
if ( cocos2d::CCDictionary::count(a1->m_colorActionDict) )
{
m_unkDict268 = a1->m_unkDict268;
if ( m_unkDict268 )
{
m_pElements = m_unkDict268->m_pElements;
while ( m_pElements )
{
m_pObject = m_pElements->m_pObject;
m_pElements = (cocos2d::CCDictElement *)m_pElements->hh.next;
if ( (m_pObject[1].m_uAutoReleaseCount & 0x100) == 0 )
{
*(_QWORD *)&m_pObject[1].m_uID = 0;
LOWORD(m_pObject[1].m_uAutoReleaseCount) = 257;
}
}
}
m_colorActionDict = a1->m_colorActionDict;
if ( m_colorActionDict )
{
next = m_colorActionDict->m_pElements;
if ( next )
{
LABEL_9:
while ( 2 )
{
v7 = (ColorAction *)next->m_pObject;
next = (cocos2d::CCDictElement *)next->hh.next;
v7->m_copyColorCalculated = 0;
v7->m_copyColorLoop = 0;
v8 = v7->m_copyID & ~(v7->m_copyID >> 31);
if ( v8 >= 9999 )
v9 = 9999;
else
v9 = (unsigned int)v8;
m_colorID = v7->m_colorID;
if ( (unsigned int)m_colorID >= 0x270F )
v11 = 9999;
else
v11 = v7->m_colorID;
if ( m_colorID <= 0 )
v12 = 0;
else
v12 = v11;
m_inheritanceNode = v7->m_inheritanceNode;
begin = a1->m_unkVector270.__begin_;
if ( !m_inheritanceNode )
{
m_inheritanceNode = begin[(unsigned int)v12];
if ( !m_inheritanceNode )
{
m_inheritanceNode = InheritanceNode::create(v12, nullptr);
cocos2d::CCDictionary::setObject(a1->m_unkDict268, m_inheritanceNode, v12);
a1->m_unkVector270.__begin_[v12] = m_inheritanceNode;
begin = a1->m_unkVector270.__begin_;
}
}
v15 = begin[(unsigned int)v9];
if ( !v15 )
{
v15 = InheritanceNode::create(v9, nullptr);
cocos2d::CCDictionary::setObject(a1->m_unkDict268, v15, v9);
a1->m_unkVector270.__begin_[v9] = v15;
}
v7->m_inheritanceNode = m_inheritanceNode;
m_inheritanceNode->m_unk051 = 0;
v15->m_unk051 = 0;
m_inheritanceNode->m_colorAction = v7;
if ( !v15->m_colorAction )
v15->m_colorAction = GJEffectManager::getColorAction(a1, v9);
v16 = v15->m_colorID;
v17 = v15;
while ( 1 )
{
if ( v16 == (_DWORD)v12 )
{
LABEL_29:
v7->m_copyColorLoop = 1;
if ( next )
goto LABEL_9;
goto LABEL_35;
}
v17 = v17->m_inheritanceNode;
if ( !v17 )
break;
v16 = v17->m_colorID;
if ( v16 == (_DWORD)v12 )
goto LABEL_29;
}
if ( m_inheritanceNode->m_inheritanceNode )
{
if ( next )
continue;
}
else
{
m_inheritanceNode->m_inheritanceNode = v15;
v15->m_unk050 = 0;
if ( next )
continue;
}
break;
}
LABEL_35:
m_unkDict268 = a1->m_unkDict268;
}
}
if ( m_unkDict268 )
{
v18 = m_unkDict268->m_pElements;
while ( v18 )
{
v19 = (InheritanceNode *)v18->m_pObject;
v18 = (cocos2d::CCDictElement *)v18->hh.next;
if ( !v19->m_unk051 && v19->m_unk050 )
GJEffectManager::traverseInheritanceChain(a1, v19);
}
}
}
}