//
// GJBaseGameLayer::processAreaTintGroupAction from 0x593d80 to 0x594228 (1192 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x5ad05c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:53:08 +0000
//
float __fastcall GJBaseGameLayer::processAreaTintGroupAction(
int a1,
cocos2d::CCArray *a2,
int a3,
cocos2d::CCPoint *a4,
char a5)
{
int v8; // r5
int active; // r0
int v10; // r3
int v11; // r2
float result; // r0
int v13; // r3
int *v14; // r3
int v15; // r4
int v16; // r11
int v17; // r5
int v18; // r11
int *v19; // r2
int v20; // r5
int *v21; // r8
int *v22; // r1
int v23; // r7
int v24; // t1
int v25; // r1
int v26; // r2
int v27; // r3
int (__fastcall *v28)(int, int *); // r10
unsigned __int8 *v29; // r0
int v30; // r0
int (__fastcall *v31)(int, int *); // r7
unsigned __int8 *v32; // r0
int v33; // r0
cocos2d::CCArray *TargetGroup; // r8
_DWORD *v35; // r2
bool *v36; // r10
GameObject *v37; // r8
GameObject *v38; // t1
int (__fastcall *v39)(GameObject *, int *); // r11
unsigned __int8 *v40; // r0
int v41; // r0
int (__fastcall *v42)(GameObject *, int *); // r11
unsigned __int8 *v43; // r0
int v44; // r0
float v45; // s16
int (__fastcall *v46)(int, int *); // r10
unsigned __int8 *v47; // r0
int v48; // r0
int (__fastcall *v49)(int, int *); // r10
unsigned __int8 *v50; // r0
int v51; // r0
cocos2d::CCArray *v52; // r7
_DWORD *v53; // r3
GameObject **v54; // r10
GameObject *v55; // r7
GameObject *v56; // t1
unsigned __int8 *v57; // r0
int v58; // r0
unsigned __int8 *v59; // r0
int v60; // r0
int v61; // [sp+Ch] [bp-58h]
int v62; // [sp+10h] [bp-54h]
int *v63; // [sp+14h] [bp-50h]
unsigned int v64; // [sp+14h] [bp-50h]
int *v66; // [sp+20h] [bp-44h]
GameObject **v67; // [sp+20h] [bp-44h]
bool *v68; // [sp+24h] [bp-40h]
bool *v69; // [sp+2Ch] [bp-38h]
bool *v70; // [sp+2Ch] [bp-38h]
bool v71; // [sp+37h] [bp-2Dh] BYREF
int v72; // [sp+38h] [bp-2Ch]
float v73; // [sp+3Ch] [bp-28h] BYREF
float v74; // [sp+40h] [bp-24h]
float v75; // [sp+44h] [bp-20h]
int v76; // [sp+48h] [bp-1Ch]
int v77[4]; // [sp+4Ch] [bp-18h] BYREF
v8 = *(_DWORD *)(a3 + 152);
active = GJEffectManager::activeColorForIndex(*(GJEffectManager **)(a1 + 1524), *(_DWORD *)(v8 + 1768));
v10 = *(unsigned __int8 *)(v8 + 1454) ^ 1;
v11 = *(unsigned __int8 *)(v8 + 1453);
LOWORD(v72) = active;
v61 = v10;
BYTE2(v72) = BYTE2(active);
v62 = v11 ^ 1;
LODWORD(result) = cocos2d::CCArray::count(a2) + *(_DWORD *)(a1 + 11484);
*(float *)(a1 + 11484) = result;
v13 = *(unsigned __int8 *)(v8 + 1821);
if ( *(_BYTE *)(v8 + 1821) )
{
if ( a2 )
{
v14 = *((int **)a2 + 13);
v15 = *v14;
if ( *v14 )
{
v16 = v15 + 0x40000000;
v15 = 0;
v17 = 0;
v63 = (int *)v14[3];
v66 = &v63[v16 - 1];
while ( v63 <= v66 )
{
v18 = *v63++;
if ( !v18 )
break;
if ( *(_BYTE *)(v18 + 657) )
{
v71 = 0;
++v17;
result = COERCE_FLOAT(
GJBaseGameLayer::getAreaObjectValue(
(GJBaseGameLayer *)a1,
(EnterEffectInstance *)a3,
(GameObject *)v18,
a4,
&v71));
if ( result < 1.0 )
{
v25 = *(_DWORD *)(a3 + 128);
v26 = *(_DWORD *)(a3 + 132);
v27 = *(_DWORD *)(a3 + 136);
v77[0] = *(_DWORD *)(a3 + 124);
v77[1] = v25;
v77[2] = v26;
v77[3] = v27;
result = COERCE_FLOAT(GameToolbox::getMultipliedHSV((int)&v73, v77, 1.0 - result));
if ( a5 )
{
TargetGroup = (cocos2d::CCArray *)GJBaseGameLayer::getTargetGroup(
(cocos2d::CCArray **)a1,
*(_DWORD *)(a3 + 180),
*(_DWORD *)(v18 + 780));
result = COERCE_FLOAT(cocos2d::CCArray::count(TargetGroup));
v15 = v15 - 1 + LODWORD(result);
if ( TargetGroup )
{
v35 = *((_DWORD **)TargetGroup + 13);
if ( *v35 )
{
v36 = (bool *)v35[3];
v68 = &v36[4 * *v35 - 4];
while ( v36 <= v68 )
{
v38 = *(GameObject **)v36;
v36 += 4;
v37 = v38;
if ( !v38 )
break;
if ( v61 )
{
v39 = *(int (__fastcall **)(GameObject *, int *))(*(_DWORD *)v37 + 792);
v40 = (unsigned __int8 *)(*(int (__fastcall **)(GameObject *))(*(_DWORD *)v37 + 472))(v37);
v41 = GameToolbox::transformColor(v40, v73, v74, v75, v76);
LOWORD(v77[0]) = v41;
BYTE2(v77[0]) = BYTE2(v41);
result = COERCE_FLOAT(v39(v37, v77));
}
if ( v62 )
{
LODWORD(result) = GameObject::hasSecondaryColor(v37);
if ( result != 0.0 )
{
v42 = *(int (__fastcall **)(GameObject *, int *))(*(_DWORD *)v37 + 796);
v43 = (unsigned __int8 *)(*(int (__fastcall **)(_DWORD *))(**((_DWORD **)v37 + 189) + 472))(*((_DWORD **)v37 + 189));
v44 = GameToolbox::transformColor(v43, v73, v74, v75, v76);
LOWORD(v77[0]) = v44;
BYTE2(v77[0]) = BYTE2(v44);
result = COERCE_FLOAT(v42(v37, v77));
}
}
}
}
}
}
else
{
if ( v61 )
{
v28 = *(int (__fastcall **)(int, int *))(*(_DWORD *)v18 + 792);
v29 = (unsigned __int8 *)(*(int (__fastcall **)(int))(*(_DWORD *)v18 + 472))(v18);
v30 = GameToolbox::transformColor(v29, v73, v74, v75, v76);
LOWORD(v77[0]) = v30;
BYTE2(v77[0]) = BYTE2(v30);
result = COERCE_FLOAT(v28(v18, v77));
}
if ( v62 )
{
LODWORD(result) = GameObject::hasSecondaryColor((GameObject *)v18);
if ( result != 0.0 )
{
v31 = *(int (__fastcall **)(int, int *))(*(_DWORD *)v18 + 796);
v32 = (unsigned __int8 *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v18 + 756) + 472))(*(_DWORD *)(v18 + 756));
v33 = GameToolbox::transformColor(v32, v73, v74, v75, v76);
LOWORD(v77[0]) = v33;
BYTE2(v77[0]) = BYTE2(v33);
result = COERCE_FLOAT(v31(v18, v77));
}
}
}
}
}
}
goto LABEL_16;
}
LABEL_15:
v17 = v15;
goto LABEL_16;
}
LABEL_14:
v15 = (int)a2;
goto LABEL_15;
}
if ( !a2 )
goto LABEL_14;
v19 = *((int **)a2 + 13);
v15 = *v19;
if ( !*v19 )
goto LABEL_15;
v20 = v15 + 0x3FFFFFFF;
v15 = v13;
v21 = (int *)v19[3];
v22 = &v21[v20];
v17 = v13;
v64 = (unsigned int)v22;
while ( (unsigned int)v21 <= v64 )
{
v24 = *v21++;
v23 = v24;
if ( !v24 )
break;
if ( *(_BYTE *)(v23 + 657) )
{
LOBYTE(v73) = 0;
++v17;
result = COERCE_FLOAT(
GJBaseGameLayer::getAreaObjectValue(
(GJBaseGameLayer *)a1,
(EnterEffectInstance *)a3,
(GameObject *)v23,
a4,
(bool *)&v73));
if ( result < 1.0 )
{
v45 = (float)(1.0 - *(float *)(a3 + 108)) + (float)(result * *(float *)(a3 + 108));
if ( a5 )
{
v52 = (cocos2d::CCArray *)GJBaseGameLayer::getTargetGroup(
(cocos2d::CCArray **)a1,
*(_DWORD *)(a3 + 180),
*(_DWORD *)(v23 + 780));
result = COERCE_FLOAT(cocos2d::CCArray::count(v52));
v15 = v15 - 1 + LODWORD(result);
if ( v52 )
{
v53 = *((_DWORD **)v52 + 13);
if ( *v53 )
{
v54 = (GameObject **)v53[3];
v67 = &v54[*v53] + 0x3FFFFFFF;
while ( v54 <= v67 )
{
v56 = *v54++;
v55 = v56;
if ( !v56 )
break;
if ( v61 )
{
v69 = *(bool **)(*(_DWORD *)v55 + 792);
v57 = (unsigned __int8 *)(*(int (__fastcall **)(GameObject *))(*(_DWORD *)v55 + 472))(v55);
v58 = GameToolbox::multipliedColorValue(v72, *v57 | (v57[1] << 8) | (v57[2] << 16), v45);
LOWORD(v77[0]) = v58;
BYTE2(v77[0]) = BYTE2(v58);
result = COERCE_FLOAT(((int (__fastcall *)(GameObject *, int *))v69)(v55, v77));
}
if ( v62 )
{
LODWORD(result) = GameObject::hasSecondaryColor(v55);
if ( result != 0.0 )
{
v70 = *(bool **)(*(_DWORD *)v55 + 796);
v59 = (unsigned __int8 *)(*(int (__fastcall **)(_DWORD *))(**((_DWORD **)v55 + 189) + 472))(*((_DWORD **)v55 + 189));
v60 = GameToolbox::multipliedColorValue(v72, *v59 | (v59[1] << 8) | (v59[2] << 16), v45);
LOWORD(v77[0]) = v60;
BYTE2(v77[0]) = BYTE2(v60);
result = COERCE_FLOAT(((int (__fastcall *)(GameObject *, int *))v70)(v55, v77));
}
}
}
}
}
}
else
{
if ( v61 )
{
v46 = *(int (__fastcall **)(int, int *))(*(_DWORD *)v23 + 792);
v47 = (unsigned __int8 *)(*(int (__fastcall **)(int))(*(_DWORD *)v23 + 472))(v23);
v48 = GameToolbox::multipliedColorValue(v72, *v47 | (v47[1] << 8) | (v47[2] << 16), v45);
LOWORD(v77[0]) = v48;
BYTE2(v77[0]) = BYTE2(v48);
result = COERCE_FLOAT(v46(v23, v77));
}
if ( v62 )
{
LODWORD(result) = GameObject::hasSecondaryColor((GameObject *)v23);
if ( result != 0.0 )
{
v49 = *(int (__fastcall **)(int, int *))(*(_DWORD *)v23 + 796);
v50 = (unsigned __int8 *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v23 + 756) + 472))(*(_DWORD *)(v23 + 756));
v51 = GameToolbox::multipliedColorValue(v72, *v50 | (v50[1] << 8) | (v50[2] << 16), v45);
LOWORD(v77[0]) = v51;
BYTE2(v77[0]) = BYTE2(v51);
result = COERCE_FLOAT(v49(v23, v77));
}
}
}
}
}
}
LABEL_16:
*(_DWORD *)(a1 + 11484) += v15;
*(_DWORD *)(a1 + 11500) += v15 + v17;
return result;
}