//
// GJBaseGameLayer::processAreaFadeGroupAction from 0x100142840 to 0x100142a8d (589 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x1001411f7
// > GJBaseGameLayer::processAreaEffects @ 0x1001413aa
//
// 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; // r8
char v6; // r12
cocos2d::ccArray *data; // rax
int v8; // r14d
GameObject **arr; // r15
unsigned __int64 v10; // rax
GameObject *v11; // r13
intptr_t m_uniqueID; // r12
cocos2d::CCDictionary *v13; // rax
cocos2d::CCObject *v14; // r12
cocos2d::CCObject_vtbl *v15; // rax
GameObject **v16; // r12
unsigned __int64 v17; // r13
GameObject *v18; // r13
float v19; // xmm1_4
int v20; // [rsp+8h] [rbp-68h]
_BOOL8 v21; // [rsp+10h] [rbp-60h]
unsigned __int64 v23; // [rsp+20h] [rbp-50h]
float AreaObjectValue; // [rsp+2Ch] [rbp-44h]
int v25; // [rsp+30h] [rbp-40h]
float m_fromOpacity; // [rsp+3Ch] [rbp-34h]
float m_toOpacity; // [rsp+40h] [rbp-30h]
float v28; // [rsp+40h] [rbp-30h]
bool v29[41]; // [rsp+47h] [rbp-29h] BYREF
v6 = v5;
v21 = a5;
m_toOpacity = a3->m_toOpacity;
m_fromOpacity = a3->m_fromOpacity;
a1->m_areaColorCount += sub_100720070(a2);
v25 = 0;
if ( a2 )
{
data = a2->data;
v8 = 0;
if ( data->num )
{
v28 = m_toOpacity - m_fromOpacity;
arr = (GameObject **)data->arr;
v10 = (unsigned __int64)&arr[data->num - 1];
v23 = v10;
if ( v6 )
{
v8 = 0;
v25 = 0;
do
{
v11 = *arr;
if ( !*arr )
break;
if ( v11->m_isActivated )
{
v29[0] = 0;
AreaObjectValue = GJBaseGameLayer::getAreaObjectValue(a1, a3, v11, (cocos2d::CCPoint *)v21, v29);
m_uniqueID = v11->m_uniqueID;
v13 = (cocos2d::CCDictionary *)sub_1007200C0(
a1->m_targetGroupsArray,
(unsigned int)(a3->m_targetGroupIndex + 1));
v14 = cocos2d::CCDictionary::objectForKey(v13, m_uniqueID);
v20 = sub_100720070(v14);
if ( v14 )
{
v15 = v14[1].__vftable;
if ( LODWORD(v15->copyWithZone) )
{
v16 = (GameObject **)v15->~CCObject_0;
v17 = (unsigned __int64)&v16[LODWORD(v15->copyWithZone) - 1];
do
{
if ( !*v16 )
break;
GameObject::setAreaOpacity(
*v16++,
(float)(AreaObjectValue * v28) + m_fromOpacity,
AreaObjectValue,
a1->m_gameState.m_commandIndex);
}
while ( (unsigned __int64)v16 <= v17 );
}
}
++v8;
v25 = v20 + v25 - 1;
v10 = v23;
}
++arr;
}
while ( (unsigned __int64)arr <= v10 );
}
else
{
v25 = 0;
v8 = 0;
do
{
v18 = *arr;
if ( !*arr )
break;
if ( v18->m_isActivated )
{
++v8;
v29[0] = 0;
v19 = GJBaseGameLayer::getAreaObjectValue(a1, a3, v18, (cocos2d::CCPoint *)v21, v29);
GameObject::setAreaOpacity(v18, (float)(v28 * v19) + m_fromOpacity, v19, a1->m_gameState.m_commandIndex);
v10 = v23;
}
++arr;
}
while ( (unsigned __int64)arr <= v10 );
}
}
}
else
{
v8 = 0;
}
a1->m_areaColorCount += v25;
a1->m_areaColorCountTotal += v25 + v8;
}