//
// GJBaseGameLayer::processAreaFadeGroupAction from 0x1001f5b60 to 0x1001f5cfc (412 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x1001f49dc
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall GJBaseGameLayer::processAreaFadeGroupAction(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
EnterEffectInstance *a3,
cocos2d::CCPoint a4,
bool a5)
{
char v5; // w4
char v6; // w20
_BOOL8 v7; // x21
float m_toOpacity; // s8
float m_fromOpacity; // s10
int m_areaColorCount; // w8
cocos2d::ccArray *data; // x10
__int64 num; // x9
int v16; // w24
int v17; // w25
float v18; // s11
GameObject **arr; // x26
unsigned __int64 v20; // x27
GameObject *v21; // x23
float AreaObjectValue; // s0
float v23; // s8
float v24; // s9
intptr_t m_uniqueID; // x23
cocos2d::CCDictionary *v26; // x0
cocos2d::CCObject *v27; // x23
cocos2d::CCObject_vtbl *v28; // x9
__int64 copyWithZone_low; // x8
GameObject **v30; // x23
unsigned __int64 v31; // x28
bool v32; // [xsp+Fh] [xbp-71h] BYREF
v6 = v5;
v7 = a5;
m_toOpacity = a3->m_toOpacity;
m_fromOpacity = a3->m_fromOpacity;
m_areaColorCount = a1->m_areaColorCount + sub_10024A36C(a2);
a1->m_areaColorCount = m_areaColorCount;
if ( a2 && (data = a2->data, num = data->num, (_DWORD)num) )
{
v16 = 0;
v17 = 0;
v18 = m_toOpacity - m_fromOpacity;
arr = (GameObject **)data->arr;
v20 = (unsigned __int64)&arr[num - 1];
do
{
v21 = *arr;
if ( !*arr )
break;
if ( v21->m_isActivated )
{
v32 = 0;
AreaObjectValue = GJBaseGameLayer::getAreaObjectValue(a1, a3, v21, (cocos2d::CCPoint *)v7, &v32);
v23 = AreaObjectValue;
v24 = m_fromOpacity + (float)(v18 * AreaObjectValue);
if ( (v6 & 1) != 0 )
{
m_uniqueID = v21->m_uniqueID;
v26 = (cocos2d::CCDictionary *)sub_10024A388(
a1->m_targetGroupsArray,
(unsigned int)(a3->m_targetGroupIndex + 1));
v27 = cocos2d::CCDictionary::objectForKey(v26, m_uniqueID);
v17 = v17 + sub_10024A36C(v27) - 1;
if ( v27 )
{
v28 = v27[1].__vftable;
copyWithZone_low = LODWORD(v28->copyWithZone);
if ( (_DWORD)copyWithZone_low )
{
v30 = (GameObject **)v28->~CCObject_0;
v31 = (unsigned __int64)&v30[copyWithZone_low - 1];
do
{
if ( !*v30 )
break;
GameObject::setAreaOpacity(*v30++, v24, v23, a1->m_gameState.m_commandIndex);
}
while ( (unsigned __int64)v30 <= v31 );
}
}
}
else
{
GameObject::setAreaOpacity(
v21,
m_fromOpacity + (float)(v18 * AreaObjectValue),
AreaObjectValue,
a1->m_gameState.m_commandIndex);
}
++v16;
}
++arr;
}
while ( (unsigned __int64)arr <= v20 );
m_areaColorCount = a1->m_areaColorCount;
}
else
{
v17 = 0;
v16 = 0;
}
a1->m_areaColorCount = m_areaColorCount + v17;
a1->m_areaColorCountTotal += v16 + v17;
}