//
// PlayLayer::loadDefaultColors from 0x5da708 to 0x5da978 (624 bytes)
//
// 4 xrefs:
// > PlayLayer::setupHasCompleted @ 0x5dc9b0
// > PlayLayer::setupHasCompleted @ 0x5dccf8
// > PlayLayer::resetLevel @ 0x5e54dc
// > ??> @ 0x4bc00
//
// 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 PlayLayer::loadDefaultColors(PlayLayer *a1)
{
unsigned __int64 v2; // x0
__int64 *v3; // x1
GJEffectManager *m_effectManager; // x0
cocos2d::CCArray *AllColorActions; // x20
unsigned int i; // w19
__int64 v7; // x4
cocos2d::CCArray *v8; // x20
unsigned int j; // w19
__int64 v10; // x0
cocos2d::CCArray *v11; // x25
unsigned int k; // w19
__int64 v13; // x20
int v14; // w21
_QWORD *v15; // [xsp+70h] [xbp+60h] BYREF
std::unordered_set *p_m_blendingColors; // [xsp+78h] [xbp+68h] BYREF
_QWORD v17[4]; // [xsp+80h] [xbp+70h] BYREF
float v18; // [xsp+A0h] [xbp+90h] BYREF
__int64 v19; // [xsp+A8h] [xbp+98h]
__int64 v20; // [xsp+B0h] [xbp+A0h] BYREF
v17[2] = 0;
v17[3] = 0;
v18 = 1.0;
v19 = 0;
v2 = sub_D146DC(&v18, 10);
v17[1] = v2;
if ( v2 == 1 )
{
v20 = 0;
v3 = &v20;
}
else
{
v3 = (__int64 *)sub_5C99C0(v2);
}
m_effectManager = a1->m_effectManager;
v17[0] = v3;
AllColorActions = GJEffectManager::getAllColorActions(m_effectManager);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(AllColorActions); ++i )
{
v7 = cocos2d::CCArray::objectAtIndex(AllColorActions, i);
if ( *(_BYTE *)(v7 + 84) )
{
LODWORD(p_m_blendingColors) = *(_DWORD *)(v7 + 92);
v15 = v17;
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_M_insert>>>(
v17,
(int *)&p_m_blendingColors);
}
}
GJEffectManager::reset(a1->m_effectManager);
v8 = GJEffectManager::getAllColorActions(a1->m_levelSettings->GJBaseGameLayer::m_effectManager);
for ( j = 0; j < (unsigned int)cocos2d::CCArray::count(v8); ++j )
{
v10 = cocos2d::CCArray::objectAtIndex(v8, j);
((void (__fastcall *)(PlayLayer *, __int64, _QWORD, _QWORD, __int64, _QWORD, _QWORD, _QWORD, float, float, _DWORD, _DWORD))a1->updateColor)(
a1,
v10 + 72,
*(unsigned int *)(v10 + 92),
*(unsigned __int8 *)(v10 + 84),
v10 + 104,
*(unsigned int *)(v10 + 120),
*(unsigned __int8 *)(v10 + 125),
0,
0.0,
*(float *)(v10 + 96),
*(_DWORD *)(v10 + 128),
*(_DWORD *)(v10 + 132));
}
v11 = GJEffectManager::getAllColorActions(a1->m_effectManager);
for ( k = 0; k < (unsigned int)cocos2d::CCArray::count(v11); ++k )
{
v13 = cocos2d::CCArray::objectAtIndex(v11, k);
v14 = *(_DWORD *)(v13 + 92);
if ( *(_BYTE *)(v13 + 84) != (sub_5C955C(v17, v14) != 0) )
{
LODWORD(v15) = v14;
p_m_blendingColors = &a1->m_blendingColors;
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_M_insert>>>(
&a1->m_blendingColors._M_h._M_buckets,
(int *)&v15);
}
}
GJEffectManager::updateEffects(a1->m_effectManager, 0.0);
GJEffectManager::calculateBaseActiveColors(a1->m_effectManager);
GJEffectManager::processInheritedColors(a1->m_effectManager);
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::~_Hashtable((__int64)v17);
}