//
// GJBaseGameLayer::processAreaTransformGroupAction from 0x47d3b4 to 0x47d6ba (774 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processAreaEffects @ 0x496a42
//
// 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
//
void GJBaseGameLayer::processAreaTransformGroupAction(
GJBaseGameLayer *a1,
cocos2d::CCArray *num,
EnterEffectInstance *a3,
cocos2d::CCPoint a4,
int a5,
int a6,
int a7,
int a8,
int a9,
bool a10,
bool a11)
{
const cocos2d::CCPoint *v14; // r0
cocos2d::ccArray *data; // r3
char *v17; // r6
cocos2d::CCObject **arr; // r8
cocos2d::CCObject **v19; // r2
cocos2d::CCArray *v20; // r6
GameObject *v21; // r4
GameObject *v22; // t1
cocos2d::CCLayer *m_objectLayer; // r0
int m_outerSectionIndex; // r3
int m_middleSectionIndex; // r3
_BOOL4 v26; // r0
float AreaObjectValue; // s15
float *v28; // r3
float v29; // s17
float v30; // s16
float EasedAreaValue; // r0
float v32; // s17
float v33; // s16
float m_scaleX; // s13
float m_scaleY; // s14
float v36; // s15
float v37; // s16
float m_scaleXOffset; // s12
cocos2d::CCArray *TargetGroup; // [sp+8h] [bp-3Ch]
int v40; // [sp+10h] [bp-34h]
int v41; // [sp+14h] [bp-30h]
unsigned int v42; // [sp+18h] [bp-2Ch]
_BOOL4 v43; // [sp+1Ch] [bp-28h]
cocos2d::CCPoint *x_low; // [sp+20h] [bp-24h]
GameObject *TargetGroupOrigin; // [sp+2Ch] [bp-18h]
bool v46; // [sp+33h] [bp-11h] BYREF
cocos2d::CCPoint v47; // [sp+34h] [bp-10h] BYREF
x_low = (cocos2d::CCPoint *)LODWORD(a4.x);
v40 = ((int (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getScaleX)(a1->m_objectLayer);
v41 = ((int (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getScaleY)(a1->m_objectLayer);
v14 = a1->m_objectLayer->getPosition(a1->m_objectLayer);
cocos2d::CCPoint::CCPoint(&v47, v14);
((void (__fastcall *)(cocos2d::CCLayer *, int))a1->m_objectLayer->setScale)(a1->m_objectLayer, 1065353216);
a1->m_objectLayer->setPosition(a1->m_objectLayer, &stru_AC68C0);
a1->m_areaScaledCount += cocos2d::CCArray::count(num);
if ( num && (data = num->data, (num = (cocos2d::CCArray *)data->num) != nullptr) )
{
v17 = (char *)&num[19173961].m_uID + 3;
num = nullptr;
arr = data->arr;
v19 = &arr[(_DWORD)v17];
v20 = nullptr;
v42 = (unsigned int)v19;
while ( (unsigned int)arr <= v42 )
{
v22 = (GameObject *)*arr++;
v21 = v22;
if ( !v22 )
break;
if ( v21->m_isActivated
|| (m_outerSectionIndex = v21->m_outerSectionIndex, m_outerSectionIndex <= a5)
&& m_outerSectionIndex >= SLODWORD(a4.y)
&& (m_middleSectionIndex = v21->m_middleSectionIndex, m_middleSectionIndex <= a7)
&& m_middleSectionIndex >= a6 )
{
v26 = GJBaseGameLayer::resetAreaObjectValues(a1, v21, 1);
v46 = 0;
v43 = v26;
AreaObjectValue = GJBaseGameLayer::getAreaObjectValue(a1, a3, v21, x_low, &v46);
if ( AreaObjectValue < 1.0 )
{
v20 = (cocos2d::CCArray *)((char *)v20 + 1);
v28 = (float *)(&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v21->m_varianceIndex);
v29 = a3->m_scaleX + (float)(a3->m_scaleXVariance * v28[679]);
v30 = a3->m_scaleY + (float)(a3->m_scaleYVariance * v28[680]);
if ( v29 == 0.0 && v30 == 0.0 )
{
v33 = 1.0;
v32 = 1.0;
}
else
{
EasedAreaValue = GJBaseGameLayer::getEasedAreaValue(a1, v21, a3, AreaObjectValue, v46, a8);
v32 = (float)((float)(v29 - 1.0) * (float)(1.0 - EasedAreaValue)) + 1.0;
v33 = (float)((float)(v30 - 1.0) * (float)(1.0 - EasedAreaValue)) + 1.0;
}
if ( (_BYTE)a9 )
{
TargetGroup = GJBaseGameLayer::getTargetGroup(a1, a3->m_targetGroupIndex, v21->m_uniqueID);
TargetGroupOrigin = (GameObject *)GJBaseGameLayer::getTargetGroupOrigin(
a1,
a3->m_targetGroupIndex,
v21->m_uniqueID);
num = (cocos2d::CCArray *)((char *)&num->data + cocos2d::CCArray::count(TargetGroup) - 53);
if ( a3->m_gameObject->m_dontEditAreaParent )
v21->m_unk508 = 1;
GJBaseGameLayer::transformAreaObjects(a1, TargetGroupOrigin, TargetGroup, v32, v33, a10);
v21->m_unk508 = 0;
}
else
{
m_scaleX = v21->m_scaleX;
m_scaleY = v21->m_scaleY;
v36 = m_scaleX * (float)(v32 - 1.0);
v37 = m_scaleY * (float)(v33 - 1.0);
if ( v36 != 0.0 || v37 != 0.0 )
{
m_scaleXOffset = v21->m_scaleXOffset;
v21->m_isDirty = 1;
v21->m_isObjectRectDirty = 1;
v21->m_scaleY = m_scaleY + v37;
v21->m_scaleXOffset = m_scaleXOffset + v36;
v21->m_unk2BC = v21->m_unk2BC + v36;
v21->m_scaleX = m_scaleX + v36;
v21->m_scaleYOffset = v21->m_scaleYOffset + v37;
v21->m_unk2C0 = v21->m_unk2C0 + v37;
if ( a10 )
((void (__fastcall *)(GameObject *, int))v21->setRScale)(v21, 1065353216);
}
}
}
if ( v43 )
a1->updateObjectSection(a1, v21);
}
++a8;
}
}
else
{
v20 = num;
}
m_objectLayer = a1->m_objectLayer;
a1->m_areaScaledCount += (int)num;
a1->m_areaScaledCountTotal += (int)v20 + (_DWORD)num;
((void (__fastcall *)(cocos2d::CCLayer *, int))m_objectLayer->setScaleX)(m_objectLayer, v40);
((void (__fastcall *)(cocos2d::CCLayer *, int))a1->m_objectLayer->setScaleY)(a1->m_objectLayer, v41);
a1->m_objectLayer->setPosition(a1->m_objectLayer, &v47);
}