//
// GJBaseGameLayer::processAreaTransformGroupAction from 0x873818 to 0x8740d4 (2236 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x89c62c
// > ??> @ 0x6fb58
//
// 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 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)
{
GJBaseGameLayer *v11; // x24
float *v12; // x23
float v15; // s9
float v16; // s10
const cocos2d::CCPoint *v17; // x0
int m_areaScaledCount; // w0
cocos2d::ccArray *data; // x2
cocos2d::CCObject **arr; // x26
__int64 v21; // x1
char *v22; // x20
__int64 v23; // x28
GJBaseGameLayer *v24; // x0
cocos2d::CCObject *v25; // x24
int v26; // w19
cocos2d::CCObject **v27; // x27
GJBaseGameLayer *v28; // x26
signed int m_commandIndex; // w0
int v30; // w21
EnterEffectObject *m_gameObject; // x2
int m_directionType; // w0
float v33; // s2
float v34; // s1
float m_offsetYVariance; // s3
float v36; // s2
float v37; // s0
float v38; // s2
bool v39; // nf
_BOOL4 v40; // w1
float m_lengthVariance; // s3
float v42; // s2
float m_deadzone; // s3
float v44; // s1
float v45; // s0
bool v46; // nf
int v47; // w19
int v48; // w25
__int64 *m_objectLayer; // x0
__int64 v50; // x1
int m_areaScaledCountTotal; // w2
void (__fastcall *v52)(__int64 *, float); // x1
float *v53; // x0
float v54; // s13
float v55; // s14
float v56; // s1
float v57; // s0
float v58; // s2
float v59; // s7
float v60; // s1
float v61; // s0
float v62; // s6
float v63; // s5
float v64; // s4
int v65; // s3
int m_nLuaID; // w0
int m_nTag; // w0
float v68; // s0
double v69; // d1
float v70; // s0
double v71; // d1
float v72; // s0
float v73; // s2
float v74; // s1
unsigned int v75; // s4
unsigned int v76; // s3
float v77; // s0
float v78; // s2
float v79; // s1
int v80; // s3
int m_areaObjectsCount; // w1
int m_areaObjectsIndex; // w3
GameObject **m_finish; // x2
float m_offsetVariance; // s4
float x; // s3
float v86; // s1
float v87; // s2
float v88; // s0
float v89; // s2
float m_modFront; // s0
unsigned int m_nZOrder; // w1
double v92; // d1
int v93; // s0
unsigned int v94; // w2
unsigned int m_uReference; // w1
int m_easeIndex; // w3
int *v97; // x7
_BOOL4 v98; // w0
float EnterEasingValue; // s0
float v100; // [xsp+B0h] [xbp+B0h]
float v101; // [xsp+C0h] [xbp+C0h]
GameObject *TargetGroupOrigin; // [xsp+D0h] [xbp+D0h]
cocos2d::CCArray *TargetGroup; // [xsp+D8h] [xbp+D8h]
int v108; // [xsp+10Ch] [xbp+10Ch]
cocos2d::CCPoint v109; // [xsp+118h] [xbp+118h] BYREF
cocos2d::CCObject *v110; // [xsp+120h] [xbp+120h] BYREF
cocos2d::CCPoint v111; // [xsp+128h] [xbp+128h] BYREF
cocos2d::CCPoint v112; // [xsp+130h] [xbp+130h] BYREF
bool v113; // [xsp+150h] [xbp+150h]
v11 = a1;
v12 = *(float **)&a5;
v15 = ((float (__fastcall *)(cocos2d::CCLayer *, long double, long double))a1->m_objectLayer->getScaleX)(
a1->m_objectLayer,
*(long double *)&a4.x,
*(long double *)&a4.y);
v16 = v11->m_objectLayer->getScaleY(v11->m_objectLayer);
v17 = v11->m_objectLayer->getPosition(v11->m_objectLayer);
cocos2d::CCPoint::CCPoint(&v109, v17);
v11->m_objectLayer->setScale(v11->m_objectLayer, 1.0);
v11->m_objectLayer->setPosition(v11->m_objectLayer, &stru_1242DA8);
m_areaScaledCount = cocos2d::CCArray::count(a2) + v11->m_areaScaledCount;
v11->m_areaScaledCount = m_areaScaledCount;
if ( !a2
|| (data = a2->data, !data->num)
|| (arr = data->arr,
v21 = 8LL * data->num - 8,
v22 = (char *)arr + v21,
arr > (cocos2d::CCObject **)((char *)arr + v21))
|| !*arr )
{
v47 = 0;
v108 = 0;
goto LABEL_33;
}
v23 = a10;
v24 = v11;
v108 = 0;
v25 = *arr;
v26 = 0;
v27 = data->arr;
v28 = v24;
do
{
if ( BYTE1(v25[13].m_nZOrder) )
{
m_commandIndex = v28->m_gameState.m_commandIndex;
if ( v25[21].m_uOrderOfArrival >= m_commandIndex )
goto LABEL_8;
}
else
{
m_nLuaID = v25[11].m_nLuaID;
if ( m_nLuaID > a7 )
goto LABEL_29;
if ( m_nLuaID < a6 )
goto LABEL_29;
m_nTag = v25[11].m_nTag;
if ( m_nTag > a9 || m_nTag < a8 )
goto LABEL_29;
m_commandIndex = v28->m_gameState.m_commandIndex;
if ( v25[21].m_uOrderOfArrival >= m_commandIndex )
{
LABEL_8:
v30 = 0;
goto LABEL_9;
}
}
if ( !BYTE2(v25[22].m_unknown2) )
{
m_nZOrder = v25[21].m_nZOrder;
if ( m_commandIndex != m_nZOrder )
{
v92 = *(double *)&v25[16].m_uIndexInArray;
v25[21].m_nZOrder = m_commandIndex;
*(float *)&v92 = v92;
*(float *)&v93 = *(double *)&v25[16].m_unknown2;
v25[21].m_uIndexInArray = LODWORD(v92);
v25[21].m_uUnknown = v93;
GameObject::dirtifyObjectRect((GameObject *)v25);
m_nZOrder = v28->m_gameState.m_commandIndex;
}
m_commandIndex = m_nZOrder;
if ( v25[21].m_unknown5 != m_nZOrder )
{
v94 = v25[20].m_nTag;
v25[21].m_unknown5 = m_nZOrder;
m_uReference = v25[20].m_uReference;
v25[17].m_uReference = v94;
v25[17].m_uAutoReleaseCount = m_uReference;
GameObject::dirtifyObjectRect((GameObject *)v25);
m_commandIndex = v28->m_gameState.m_commandIndex;
}
}
v68 = *(float *)&v25[11].m_unknown5;
v30 = 0;
if ( v68 != 0.0 )
{
v69 = *(double *)&v25[16].m_uIndexInArray;
BYTE2(v25[14].m_unknown2) = 1;
v30 = 1;
v25[11].m_unknown5 = 0;
*(double *)&v25[16].m_uIndexInArray = v69 - v68;
}
v70 = *(float *)&v25[12].__vftable;
if ( v70 != 0.0 )
{
v71 = *(double *)&v25[16].m_unknown2;
BYTE2(v25[14].m_unknown2) = 1;
v30 = 1;
LODWORD(v25[12].__vftable) = 0;
*(double *)&v25[16].m_unknown2 = v71 - v70;
}
v72 = *(float *)&v25[12].m_eObjType;
v73 = *(float *)&v25[12].m_uIndexInArray;
if ( v72 != 0.0 || v73 != 0.0 )
{
v74 = *(float *)&v25[20].m_nTag;
*(float *)&v75 = *(float *)&v25[12].m_uAutoReleaseCount - v73;
*(float *)&v76 = *(float *)&v25[20].m_uReference - v73;
*(float *)&v25[12].m_uReference = *(float *)&v25[12].m_uReference - v72;
v25[12].m_eObjType = 0;
*(float *)&v25[20].m_nTag = v74 - v72;
v25[12].m_uAutoReleaseCount = v75;
v25[20].m_uReference = v76;
v25[12].m_uIndexInArray = 0;
}
v77 = *(float *)&v25[12].m_uID;
v78 = *(float *)&v25[12].m_nTag;
if ( v77 != 0.0 || v78 != 0.0 )
{
v79 = *((float *)&v25[12].__vftable + 1) - v77;
*(float *)&v80 = *(float *)&v25[12].m_nLuaID - v78;
v25[12].m_uID = 0;
*((float *)&v25[12].__vftable + 1) = v79;
v25[12].m_nLuaID = v80;
v25[12].m_nTag = 0;
}
m_areaObjectsCount = v28->m_areaObjectsCount;
m_areaObjectsIndex = v28->m_areaObjectsIndex;
v110 = v25;
v25[21].m_uOrderOfArrival = m_commandIndex;
if ( m_areaObjectsIndex > m_areaObjectsCount )
{
v28->m_areaObjects.m_start[m_areaObjectsCount] = (GameObject *)v25;
}
else
{
m_finish = v28->m_areaObjects.m_finish;
if ( m_finish == v28->m_areaObjects.m_reserveEnd )
{
std::vector::_M_emplace_back_aux((__int64)&v28->m_areaObjects, &v110);
m_areaObjectsCount = v28->m_areaObjectsCount;
m_areaObjectsIndex = v28->m_areaObjectsIndex;
}
else
{
if ( m_finish )
{
*m_finish = (GameObject *)v25;
m_finish = v28->m_areaObjects.m_finish;
}
v28->m_areaObjects.m_finish = m_finish + 1;
}
v28->m_areaObjectsIndex = m_areaObjectsIndex + 1;
}
v28->m_areaObjectsCount = m_areaObjectsCount + 1;
LABEL_9:
v25->__vftable[16].getTag(v25);
m_gameObject = a3->m_gameObject;
m_directionType = m_gameObject->m_directionType;
if ( m_directionType == 1 )
{
m_offsetVariance = a3->m_offsetVariance;
x = v111.x;
v86 = *v12;
v87 = 0.0;
v88 = v111.x - *v12;
if ( m_offsetVariance == 0.0 )
goto LABEL_75;
goto LABEL_74;
}
if ( m_directionType == 2 )
{
m_offsetVariance = a3->m_offsetVariance;
x = v111.y;
v86 = v12[1];
v88 = v111.y - v86;
if ( m_offsetVariance == 0.0 )
{
v89 = v88 + 0.0;
if ( (float)(v88 + 0.0) < 0.0 )
goto LABEL_82;
goto LABEL_76;
}
LABEL_74:
v87 = m_offsetVariance * v28->m_varianceValues.__elems_[SLOWORD(v25[17].m_uUnknown) + 1];
LABEL_75:
v89 = v88 + v87;
if ( v89 < 0.0 )
{
LABEL_82:
m_modFront = a3->m_modFront;
LABEL_77:
v37 = v89 * m_modFront;
v39 = x < v86;
if ( a3->m_reversed )
{
v40 = x <= v86;
goto LABEL_20;
}
goto LABEL_17;
}
LABEL_76:
m_modFront = a3->m_modBack;
goto LABEL_77;
}
v33 = a3->m_offsetVariance;
v34 = 0.0;
if ( v33 != 0.0 )
v34 = v33 * v28->m_varianceValues.__elems_[SLOWORD(v25[17].m_uUnknown) + 1];
m_offsetYVariance = a3->m_offsetYVariance;
v36 = 0.0;
if ( m_offsetYVariance != 0.0 )
v36 = m_offsetYVariance * *((float *)&v28->m_uID + SLOWORD(v25[17].m_uUnknown) + 1097);
cocos2d::CCPoint::CCPoint(&v112, *v12 + v34, v12[1] + v36);
v37 = cocos2d::ccpDistance(&v111, &v112);
v38 = *v12;
m_gameObject = a3->m_gameObject;
if ( !a3->m_reversed )
{
v40 = v38 <= v111.y;
goto LABEL_20;
}
v39 = v38 < v111.x;
LABEL_17:
v40 = !v39;
LABEL_20:
m_lengthVariance = a3->m_lengthVariance;
v42 = 0.0;
if ( m_lengthVariance != 0.0 )
v42 = m_lengthVariance * v28->m_varianceValues.__elems_[SLOWORD(v25[17].m_uUnknown)];
m_deadzone = a3->m_deadzone;
v44 = (float)(int)(float)(a3->m_length + v42);
if ( m_deadzone == 0.0 )
{
v45 = v37 / v44;
v46 = v45 < 1.0;
if ( v45 >= 1.0 )
goto LABEL_70;
}
else
{
v45 = (float)((float)(v37 / v44) - m_deadzone) / (float)(1.0 - m_deadzone);
v46 = v45 < 1.0;
if ( v45 >= 1.0 )
{
LABEL_70:
if ( v46 )
{
if ( !m_gameObject->m_inbound )
goto LABEL_35;
v45 = 1.0 - v45;
}
else
{
v45 = 0.0;
if ( !m_gameObject->m_inbound )
goto LABEL_28;
}
goto LABEL_27;
}
}
if ( v45 > 0.0 )
{
if ( m_gameObject->m_inbound )
v45 = 1.0 - v45;
}
else
{
if ( !m_gameObject->m_inbound )
{
v45 = 0.0;
goto LABEL_35;
}
v45 = 1.0;
}
LABEL_27:
if ( v45 >= 1.0 )
goto LABEL_28;
LABEL_35:
++v26;
v53 = (float *)((char *)v28 + 4 * SLOWORD(v25[17].m_uUnknown));
v54 = a3->m_scaleY + (float)(a3->m_scaleYVariance * v53[1110]);
v55 = a3->m_scaleX + (float)(a3->m_scaleXVariance * v53[1109]);
if ( v54 == 0.0 && v55 == 0.0 )
{
v56 = 1.0;
v57 = 1.0;
}
else
{
if ( !m_gameObject->m_easeOutEnabled )
goto LABEL_103;
if ( v45 > 0.01 && v45 < 0.99 )
{
m_easeIndex = a3->m_easeIndex;
v97 = &a3->m_easeIndices.m_start[v23];
if ( *v97 == m_easeIndex - 2 )
{
v98 = 0;
v40 = 0;
}
else
{
if ( *v97 == m_easeIndex - 1 )
v40 = 1;
v98 = v40;
}
*v97 = m_easeIndex + v98;
}
if ( v40 )
LABEL_103:
EnterEasingValue = GJBaseGameLayer::getEnterEasingValue(
v28,
v45,
m_gameObject->m_easingInType,
m_gameObject->m_easingInRate,
m_gameObject->m_easingInBuffer);
else
EnterEasingValue = GJBaseGameLayer::getEnterEasingValue(
v28,
v45,
m_gameObject->m_easingOutType,
m_gameObject->m_easingOutRate,
m_gameObject->m_easingOutBuffer);
v56 = (float)((float)(v54 - 1.0) * (float)(1.0 - EnterEasingValue)) + 1.0;
v57 = (float)((float)(v55 - 1.0) * (float)(1.0 - EnterEasingValue)) + 1.0;
}
if ( a11 )
{
v100 = v56;
v101 = v57;
TargetGroup = GJBaseGameLayer::getTargetGroup(v28, a3->m_targetGroupIndex, HIDWORD(v25[16].__vftable));
TargetGroupOrigin = (GameObject *)GJBaseGameLayer::getTargetGroupOrigin(
v28,
a3->m_targetGroupIndex,
HIDWORD(v25[16].__vftable));
v108 = v108 - 1 + cocos2d::CCArray::count(TargetGroup);
if ( a3->m_gameObject->m_dontEditAreaParent )
LOBYTE(v25[23].__vftable) = 1;
GJBaseGameLayer::transformAreaObjects(v28, TargetGroupOrigin, TargetGroup, v101, v100, v113);
LOBYTE(v25[23].__vftable) = 0;
LABEL_28:
if ( v30 )
goto LABEL_43;
goto LABEL_29;
}
v58 = *(float *)&v25[20].m_uReference;
v59 = *(float *)&v25[20].m_nTag;
v60 = v58 * (float)(v56 - 1.0);
v61 = v59 * (float)(v57 - 1.0);
if ( v60 == 0.0 && v61 == 0.0 )
goto LABEL_28;
v62 = *(float *)&v25[12].m_uReference;
v63 = *(float *)&v25[12].m_eObjType;
LOBYTE(v25[14].m_unknown2) = 1;
v64 = *(float *)&v25[12].m_uAutoReleaseCount;
LOBYTE(v25[15].m_uID) = 1;
*(float *)&v65 = *(float *)&v25[12].m_uIndexInArray + v60;
*(float *)&v25[12].m_uReference = v62 + v61;
*(float *)&v25[12].m_eObjType = v63 + v61;
*(float *)&v25[20].m_nTag = v59 + v61;
*(float *)&v25[12].m_uAutoReleaseCount = v64 + v60;
v25[12].m_uIndexInArray = v65;
*(float *)&v25[20].m_uReference = v58 + v60;
if ( !v113 )
goto LABEL_28;
((void (__fastcall *)(cocos2d::CCObject *, float))v25->__vftable[18].copyWithZone)(v25, 1.0);
if ( v30 )
LABEL_43:
v28->updateObjectSection(v28, (GameObject *)v25);
LABEL_29:
if ( v22 < (char *)++v27 )
break;
v25 = *v27;
++v23;
}
while ( *v27 );
v11 = v28;
m_areaScaledCount = v28->m_areaScaledCount;
v47 = v26 + v108;
LABEL_33:
v48 = v108 + m_areaScaledCount;
m_objectLayer = (__int64 *)v11->m_objectLayer;
v50 = *m_objectLayer;
m_areaScaledCountTotal = v11->m_areaScaledCountTotal;
v11->m_areaScaledCount = v48;
v52 = *(void (__fastcall **)(__int64 *, float))(v50 + 128);
v11->m_areaScaledCountTotal = m_areaScaledCountTotal + v47;
v52(m_objectLayer, v15);
v11->m_objectLayer->setScaleY(v11->m_objectLayer, v16);
v11->m_objectLayer->setPosition(v11->m_objectLayer, &v109);
}