//
// GJBaseGameLayer::processAreaTransformGroupAction from 0x1001418b0 to 0x100141cef (1087 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x1001411d3
// > GJBaseGameLayer::processAreaEffects @ 0x10014137a
//
// 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::processAreaTransformGroupAction(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
EnterEffectInstance *a3,
cocos2d::CCPoint a4,
int a5,
int a6,
int a7,
int a8,
int a9,
bool a10,
bool a11)
{
__int64 v14; // rsi
int m_areaScaledCount; // eax
int v16; // esi
cocos2d::ccArray *data; // rcx
__int64 num; // rdx
int v19; // edi
int v20; // r14d
GameObject **arr; // r12
GameObject *v22; // r15
unsigned int *v23; // r13
float AreaObjectValue; // xmm0_4
__m128 v25; // xmm4
__m128 v26; // xmm3
EnterEffectInstance *v27; // r13
int m_targetGroupIndex; // esi
cocos2d::CCDictionary *v29; // rax
int v30; // esi
cocos2d::CCDictionary *v31; // rax
int v32; // eax
__m128 v33; // xmm1
__m128 v34; // xmm0
__m128 v35; // xmm3
_BYTE v36[8]; // [rsp+18h] [rbp-88h] BYREF
unsigned __int64 v37; // [rsp+20h] [rbp-80h]
cocos2d::CCPoint *v38; // [rsp+28h] [rbp-78h]
__m128 v39; // [rsp+30h] [rbp-70h]
int v40; // [rsp+44h] [rbp-5Ch]
int v41; // [rsp+48h] [rbp-58h]
float v42; // [rsp+4Ch] [rbp-54h]
float v43; // [rsp+50h] [rbp-50h]
int v44; // [rsp+54h] [rbp-4Ch]
EnterEffectInstance *v45; // [rsp+58h] [rbp-48h]
__int64 v46; // [rsp+60h] [rbp-40h]
GameObject *m_uniqueID; // [rsp+68h] [rbp-38h]
int v48; // [rsp+70h] [rbp-30h]
bool v49; // [rsp+76h] [rbp-2Ah]
bool v50; // [rsp+77h] [rbp-29h] BYREF
unsigned __int8 v51; // [rsp+D0h] [rbp+30h]
v40 = a7;
v41 = a6;
v38 = *(cocos2d::CCPoint **)&a5;
v42 = ((float (__fastcall *)(cocos2d::CCLayer *, double))a1->m_objectLayer->getScaleX)(
a1->m_objectLayer,
*(double *)&a4);
v43 = ((float (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getScaleY)(a1->m_objectLayer);
v14 = ((__int64 (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getPosition)(a1->m_objectLayer);
sub_10028CC60(v36);
((void (__fastcall *)(cocos2d::CCLayer *, __int64, float))a1->m_objectLayer->setScale)(a1->m_objectLayer, v14, 1.0);
((void (__fastcall *)(cocos2d::CCLayer *, __int64 *))a1->m_objectLayer->setPosition)(
a1->m_objectLayer,
&qword_10099EFF0);
m_areaScaledCount = a1->m_areaScaledCount + sub_100720070(a2);
a1->m_areaScaledCount = m_areaScaledCount;
v16 = 0;
if ( !a2 )
{
v19 = 0;
goto LABEL_26;
}
data = a2->data;
num = data->num;
v19 = 0;
if ( data->num )
{
v45 = a3;
v20 = a10;
arr = (GameObject **)data->arr;
v37 = (unsigned __int64)&arr[num - 1];
v48 = 0;
v44 = v51;
v46 = 0;
while ( 1 )
{
v22 = *arr;
if ( !*arr )
{
LABEL_24:
m_areaScaledCount = a1->m_areaScaledCount;
v16 = v46;
v19 = v48;
goto LABEL_26;
}
if ( v22->m_isActivated
|| v22->m_outerSectionIndex <= v40
&& v22->m_outerSectionIndex >= v41
&& v22->m_middleSectionIndex <= a9
&& v22->m_middleSectionIndex >= a8 )
{
break;
}
LABEL_4:
++arr;
++v20;
if ( (unsigned __int64)arr > v37 )
goto LABEL_24;
}
v49 = GJBaseGameLayer::resetAreaObjectValues(a1, *arr, 1);
v50 = 0;
v23 = (unsigned int *)v45;
AreaObjectValue = GJBaseGameLayer::getAreaObjectValue(a1, v45, v22, v38, &v50);
if ( AreaObjectValue >= 1.0 )
{
LABEL_22:
if ( v49 )
((void (__fastcall *)(GJBaseGameLayer *, GameObject *))a1->updateObjectSection)(a1, v22);
goto LABEL_4;
}
v25 = _mm_add_ps(
_mm_insert_ps((__m128)v23[24], (__m128)v23[26], 16),
_mm_mul_ps(
_mm_insert_ps((__m128)v23[25], (__m128)v23[27], 16),
(__m128)*(unsigned __int64 *)&a1->m_varianceValues.__elems_[v22->m_varianceIndex + 12]));
if ( v25.f32[0] == 0.0 && (v26 = (__m128)xmmword_1008154E0, _mm_movehdup_ps(v25).f32[0] == 0.0) )
{
++v48;
if ( a11 )
{
LABEL_11:
v27 = v45;
m_targetGroupIndex = v45->m_targetGroupIndex;
v39.i64[0] = v22->m_uniqueID;
v29 = (cocos2d::CCDictionary *)sub_1007200C0(a1->m_targetGroupsArray, (unsigned int)(m_targetGroupIndex + 1));
v39.i64[0] = (__int64)cocos2d::CCDictionary::objectForKey(v29, v39.i64[0]);
v30 = v27->m_targetGroupIndex;
m_uniqueID = (GameObject *)v22->m_uniqueID;
v31 = (cocos2d::CCDictionary *)sub_1007200C0(a1->m_targetGroupsArray, (unsigned int)(v30 + 2));
m_uniqueID = (GameObject *)cocos2d::CCDictionary::objectForKey(v31, (intptr_t)m_uniqueID);
v32 = sub_100720070(v39.i64[0]);
if ( v27->m_gameObject->m_dontEditAreaParent )
v22->m_unk508 = 1;
v46 = (unsigned int)(v32 + v46 - 1);
GJBaseGameLayer::transformAreaObjects(
a1,
m_uniqueID,
(cocos2d::CCArray *)v39.i64[0],
v26.f32[0],
_mm_movehdup_ps(v26).f32[0],
v44);
v22->m_unk508 = 0;
goto LABEL_22;
}
}
else
{
v39 = v25;
v33 = (__m128)0x3F800000u;
v33.f32[0] = 1.0 - GJBaseGameLayer::getEasedAreaValue(a1, v22, v45, AreaObjectValue, v50, v20);
v26 = _mm_add_ps(
_mm_mul_ps(_mm_moveldup_ps(v33), _mm_add_ps(v39, (__m128)xmmword_1008154C0)),
(__m128)xmmword_1008154E0);
++v48;
if ( a11 )
goto LABEL_11;
}
v34 = (__m128)*(unsigned __int64 *)&v22->m_scaleX;
v35 = _mm_mul_ps(_mm_add_ps(v26, (__m128)xmmword_1008154C0), v34);
if ( v35.f32[0] != 0.0 || _mm_movehdup_ps(v35).f32[0] != 0.0 )
{
*(__m128 *)&v22->m_scaleXOffset = _mm_add_ps(
*(__m128 *)&v22->m_scaleXOffset,
(__m128)_mm_movedup_pd((__m128d)v35));
_mm_storel_ps((double *)&v22->m_scaleX, _mm_add_ps(v34, v35));
v22->m_isDirty = 1;
v22->m_isObjectRectDirty = 1;
if ( v51 )
((void (__fastcall *)(GameObject *, float))v22->setRScale)(v22, 1.0);
}
goto LABEL_22;
}
LABEL_26:
a1->m_areaScaledCount = v16 + m_areaScaledCount;
a1->m_areaScaledCountTotal += v16 + v19;
((void (__fastcall *)(cocos2d::CCLayer *, float))a1->m_objectLayer->setScaleX)(a1->m_objectLayer, v42);
((void (__fastcall *)(cocos2d::CCLayer *, float))a1->m_objectLayer->setScaleY)(a1->m_objectLayer, v43);
((void (__fastcall *)(cocos2d::CCLayer *, _BYTE *))a1->m_objectLayer->setPosition)(a1->m_objectLayer, v36);
}