//
// GJBaseGameLayer::processAreaMoveGroupAction from 0x1001f54d4 to 0x1001f5b60 (1676 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x1001f4a1c
//
// 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::processAreaMoveGroupAction(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
EnterEffectInstance *a3,
cocos2d::CCPoint a4,
int a5,
int a6,
int a7,
int a8,
int a9,
bool a10,
bool a11)
{
float m_relativeFade; // s8
int m_areaMovedCount; // w8
cocos2d::ccArray *data; // x10
__int64 num; // x9
float v22; // s9
GameObject **arr; // x22
__int64 v24; // x24
cocos2d::CCPoint *v25; // x20
GameObject *v26; // x26
float AreaObjectValue; // s0
__int64 v28; // x9
EnterEffectObject *v29; // x8
float *v30; // x10
float v31; // s13
float v32; // s14
float v33; // s15
float v34; // s8
_BOOL4 v35; // w10
std::__vector_base::pointer begin; // x11
int v37; // w13
int m_easeIndex; // w12
int m_outerSectionIndex; // w8
bool v40; // cc
int m_middleSectionIndex; // w8
bool v42; // cc
float m_moveDistanceVariance; // s1
float v44; // s2
float v45; // s13
_BOOL4 v46; // w10
std::__vector_base::pointer v47; // x11
int v48; // w13
int v49; // w12
int m_easingInType; // w1
float m_easingInRate; // s1
int m_easingInBuffer; // w2
int m_easingOutType; // w1
float m_easingOutRate; // s1
int m_easingOutBuffer; // w2
float EnterEasingValue; // s8
__n128 v57; // q0
__n128 v58; // q1
float v59; // s2
double *p_m_anglePosition; // x1
float v61; // s0
float v62; // s0
intptr_t m_uniqueID; // x20
cocos2d::CCDictionary *v64; // x0
cocos2d::CCObject *v65; // x20
int v66; // w28
cocos2d::CCObject_vtbl *v67; // x9
__int64 copyWithZone_low; // x8
GameObject **v69; // x23
unsigned __int64 v70; // x27
_BOOL4 v71; // w21
GameObject *v72; // x20
_BOOL4 v73; // w0
_BOOL4 v74; // w0
int v75; // w10
int v76; // [xsp+8h] [xbp-108h]
int v77; // [xsp+Ch] [xbp-104h]
int v78; // [xsp+10h] [xbp-100h]
int v79; // [xsp+14h] [xbp-FCh]
std::array *p_m_varianceValues; // [xsp+18h] [xbp-F8h]
cocos2d::CCPoint *v81; // [xsp+28h] [xbp-E8h]
int v82; // [xsp+34h] [xbp-DCh]
EnterEffectObject *m_gameObject; // [xsp+38h] [xbp-D8h]
unsigned __int64 v84; // [xsp+48h] [xbp-C8h]
_BOOL4 v85; // [xsp+54h] [xbp-BCh]
int v86; // [xsp+58h] [xbp-B8h]
float32x2_t v87; // [xsp+5Ch] [xbp-B4h] BYREF
float32x2_t v88; // [xsp+64h] [xbp-ACh] BYREF
__int64 v89; // [xsp+6Ch] [xbp-A4h] BYREF
bool v90; // [xsp+77h] [xbp-99h] BYREF
char v91; // [xsp+124h] [xbp+14h]
v81 = *(cocos2d::CCPoint **)&a5;
m_gameObject = a3->m_gameObject;
m_relativeFade = m_gameObject->m_relativeFade;
m_areaMovedCount = a1->m_areaMovedCount + sub_10024A36C(a2);
a1->m_areaMovedCount = m_areaMovedCount;
if ( !a2 )
{
v75 = 0;
LODWORD(num) = 0;
goto LABEL_96;
}
data = a2->data;
num = data->num;
if ( !(_DWORD)num )
{
v75 = 0;
goto LABEL_96;
}
v86 = 0;
v82 = 0;
v22 = fmaxf(m_relativeFade, 0.0);
arr = (GameObject **)data->arr;
p_m_varianceValues = &a1->m_varianceValues;
v84 = (unsigned __int64)&arr[num - 1];
v24 = -1;
v25 = v81;
v78 = a8;
v79 = a9;
v76 = a6;
v77 = a7;
do
{
v26 = *arr;
if ( !*arr )
break;
++v24;
if ( v26->m_isActivated
|| ((m_outerSectionIndex = v26->m_outerSectionIndex, m_outerSectionIndex <= a7)
? (v40 = m_outerSectionIndex < a6)
: (v40 = 1),
!v40
&& ((m_middleSectionIndex = v26->m_middleSectionIndex, m_middleSectionIndex <= a9)
? (v42 = m_middleSectionIndex < a8)
: (v42 = 1),
!v42)) )
{
v85 = GJBaseGameLayer::resetAreaObjectValues(a1, *arr, 1);
v90 = 0;
AreaObjectValue = GJBaseGameLayer::getAreaObjectValue(a1, a3, v26, v25, &v90);
v28 = v24 + a10;
if ( AreaObjectValue >= 1.0 )
{
if ( m_gameObject->m_easeOutEnabled )
a3->m_easeIndices.__begin_[v28] = 0;
goto LABEL_89;
}
v29 = a3->m_gameObject;
if ( v29->m_xyMode )
{
v30 = &p_m_varianceValues->__elems_[v26->m_varianceIndex];
v31 = a3->m_moveX + (float)(a3->m_moveXVariance * v30[8]);
v32 = a3->m_moveY + (float)(a3->m_moveYVariance * v30[9]);
if ( v31 == 0.0 )
{
v33 = 0.0;
v34 = 0.0;
if ( v32 == 0.0 )
goto LABEL_59;
}
if ( v29->m_easeOutEnabled )
{
v35 = v90;
if ( AreaObjectValue <= 0.01 || AreaObjectValue >= 0.99 )
{
if ( !v90 )
goto LABEL_57;
}
else
{
begin = a3->m_easeIndices.__begin_;
v37 = begin[v28];
m_easeIndex = a3->m_easeIndex;
if ( v37 == m_easeIndex - 2 )
{
begin[v28] = m_easeIndex;
goto LABEL_57;
}
if ( v37 == m_easeIndex - 1 )
v35 = 1;
begin[v28] = m_easeIndex + v35;
if ( !v35 )
{
LABEL_57:
m_easingOutType = v29->m_easingOutType;
m_easingOutRate = v29->m_easingOutRate;
m_easingOutBuffer = v29->m_easingOutBuffer;
LABEL_58:
v62 = 1.0
- GJBaseGameLayer::getEnterEasingValue(
a1,
AreaObjectValue,
m_easingOutType,
m_easingOutRate,
m_easingOutBuffer);
v34 = v31 * v62;
v33 = v32 * v62;
LABEL_59:
if ( (v91 & 1) != 0 )
{
m_uniqueID = v26->m_uniqueID;
v64 = (cocos2d::CCDictionary *)sub_10024A388(
a1->m_targetGroupsArray,
(unsigned int)(a3->m_targetGroupIndex + 1));
v65 = cocos2d::CCDictionary::objectForKey(v64, m_uniqueID);
v66 = sub_10024A36C(v65);
if ( a3->m_gameObject->m_dontEditAreaParent )
v26->m_unk508 = 1;
if ( v65 )
{
v67 = v65[1].__vftable;
copyWithZone_low = LODWORD(v67->copyWithZone);
if ( (_DWORD)copyWithZone_low )
{
v69 = (GameObject **)v67->~CCObject_0;
v70 = (unsigned __int64)&v69[copyWithZone_low - 1];
v71 = v34 != 0.0 || v33 != 0.0;
do
{
v72 = *v69;
if ( !*v69 )
break;
if ( !v72->m_unk508 )
{
v73 = GJBaseGameLayer::resetAreaObjectValues(a1, *v69, 1);
if ( v71 )
{
if ( v33 != 0.0 )
{
v72->m_positionY = v72->m_positionY + v33;
v72->m_positionYOffset = v33 + v72->m_positionYOffset;
}
GameObject::dirtifyObjectPos(v72);
GameObject::dirtifyObjectRect(v72);
if ( v34 != 0.0 && !v72->m_tempOffsetXRelated )
{
v72->m_positionXOffset = v34 + v72->m_positionXOffset;
v72->m_positionX = v72->m_positionX + v34;
}
LABEL_76:
((void (__fastcall *)(GJBaseGameLayer *, GameObject *))a1->updateObjectSection)(a1, v72);
goto LABEL_77;
}
if ( v73 )
goto LABEL_76;
}
LABEL_77:
++v69;
}
while ( (unsigned __int64)v69 <= v70 );
}
}
v82 = v82 + v66 - 1;
v26->m_unk508 = 0;
a8 = v78;
a9 = v79;
a6 = v76;
a7 = v77;
v25 = v81;
goto LABEL_89;
}
v74 = GJBaseGameLayer::resetAreaObjectValues(a1, v26, 1);
if ( v33 == 0.0 && v34 == 0.0 )
{
if ( !v74 )
goto LABEL_89;
}
else
{
if ( v33 != 0.0 )
{
v26->m_positionY = v26->m_positionY + v33;
v26->m_positionYOffset = v33 + v26->m_positionYOffset;
}
GameObject::dirtifyObjectPos(v26);
GameObject::dirtifyObjectRect(v26);
if ( v34 != 0.0 && !v26->m_tempOffsetXRelated )
{
v26->m_positionXOffset = v34 + v26->m_positionXOffset;
v26->m_positionX = v26->m_positionX + v34;
}
}
((void (__fastcall *)(GJBaseGameLayer *, GameObject *))a1->updateObjectSection)(a1, v26);
LABEL_89:
if ( v85 )
((void (__fastcall *)(GJBaseGameLayer *, GameObject *))a1->updateObjectSection)(a1, v26);
++v86;
goto LABEL_92;
}
}
}
m_easingOutType = v29->m_easingInType;
m_easingOutRate = v29->m_easingInRate;
m_easingOutBuffer = v29->m_easingInBuffer;
goto LABEL_58;
}
m_moveDistanceVariance = a3->m_moveDistanceVariance;
v33 = 0.0;
v44 = 0.0;
if ( m_moveDistanceVariance != 0.0 )
v44 = m_moveDistanceVariance * p_m_varianceValues->__elems_[v26->m_varianceIndex + 10];
v45 = a3->m_moveDistance + v44;
v34 = 0.0;
if ( v45 == 0.0 )
goto LABEL_59;
if ( v29->m_easeOutEnabled )
{
v46 = v90;
if ( AreaObjectValue <= 0.01 || AreaObjectValue >= 0.99 )
{
if ( !v90 )
goto LABEL_42;
}
else
{
v47 = a3->m_easeIndices.__begin_;
v48 = v47[v28];
v49 = a3->m_easeIndex;
if ( v48 == v49 - 2 )
{
v47[v28] = v49;
goto LABEL_42;
}
if ( v48 == v49 - 1 )
v46 = 1;
v47[v28] = v49 + v46;
if ( !v46 )
{
LABEL_42:
m_easingInType = v29->m_easingOutType;
m_easingInRate = v29->m_easingOutRate;
m_easingInBuffer = v29->m_easingOutBuffer;
LABEL_43:
EnterEasingValue = GJBaseGameLayer::getEnterEasingValue(
a1,
AreaObjectValue,
m_easingInType,
m_easingInRate,
m_easingInBuffer);
sub_1000229B0(&v89);
if ( m_gameObject->m_relative )
{
((void (__fastcall *)(float32x2_t *__return_ptr, GameObject *))v26->getRealPosition)(&v87, v26);
sub_1000229F0(&v87, (float32x2_t *)v25, &v88);
v57.n128_f64[0] = sub_1000229D0(&v89, (double *)&v88);
v59 = sqrtf((float)(*((float *)&v89 + 1) * *((float *)&v89 + 1)) + (float)(*(float *)&v89 * *(float *)&v89));
if ( v59 < v22 )
v45 = v45 * (float)((float)(1.0 / v22) * v59);
if ( v59 > 0.0 )
{
v57.n128_f32[0] = *(float *)&v89 / v59;
v58.n128_f32[0] = *((float *)&v89 + 1) / v59;
sub_100022980(v57, v58, &v88);
goto LABEL_51;
}
}
else
{
if ( m_gameObject->m_startAngle )
{
p_m_anglePosition = (double *)&m_gameObject->m_anglePosition;
}
else
{
cocos2d::ccpForAngle(
(float)((float)(a3->m_moveAngle
+ (float)(a3->m_moveAngleVariance
* p_m_varianceValues->__elems_[v26->m_varianceIndex + 11]))
+ -90.0)
* 0.017453);
LABEL_51:
p_m_anglePosition = (double *)&v88;
}
sub_1000229D0(&v89, p_m_anglePosition);
}
v61 = (float)(1.0 - EnterEasingValue) * v45;
v34 = *(float *)&v89 * v61;
v33 = v61 * *((float *)&v89 + 1);
goto LABEL_59;
}
}
}
m_easingInType = v29->m_easingInType;
m_easingInRate = v29->m_easingInRate;
m_easingInBuffer = v29->m_easingInBuffer;
goto LABEL_43;
}
LABEL_92:
++arr;
}
while ( (unsigned __int64)arr <= v84 );
m_areaMovedCount = a1->m_areaMovedCount;
LODWORD(num) = v86;
v75 = v82;
LABEL_96:
a1->m_areaMovedCount = m_areaMovedCount + v75;
a1->m_areaMovedCountTotal += num + v75;
}