//
// GJBaseGameLayer::rotateAreaObjects from 0x1001f6cc4 to 0x1001f705c (920 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processAreaRotateGroupAction @ 0x1001f53d8
//
// 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::rotateAreaObjects(
GJBaseGameLayer *a1,
GameObject *a2,
cocos2d::CCArray *a3,
float a4,
bool a5)
{
_BOOL4 v5; // w21
cocos2d::ccArray *data; // x9
__int64 num; // x8
GameObject **arr; // x25
unsigned __int64 v12; // x26
GameObject *v13; // x22
_BOOL4 v14; // w23
cocos2d::CCNode *m_areaTransformNode2; // x24
double v16; // d0
float v17; // s8
float v18; // s9
_BOOL4 v19; // w0
__n128 v20; // q0
float32x4_t v21; // [xsp+0h] [xbp-E0h]
__n128 v22; // [xsp+10h] [xbp-D0h]
cocos2d::CCAffineTransform v23; // [xsp+28h] [xbp-B8h] BYREF
cocos2d::CCAffineTransform v24; // [xsp+40h] [xbp-A0h] BYREF
float32x2_t v25; // [xsp+58h] [xbp-88h] BYREF
cocos2d::CCAffineTransform v26; // [xsp+60h] [xbp-80h] BYREF
float32x2_t v27; // [xsp+78h] [xbp-68h] BYREF
v5 = a5;
v22 = *(__n128 *)&a4;
if ( GJBaseGameLayer::resetAreaObjectValues(a1, a2, 1) )
((void (__fastcall *)(GJBaseGameLayer *, GameObject *))a1->updateObjectSection)(a1, a2);
((void (__fastcall *)(float32x2_t *__return_ptr, GameObject *))a2->getRealPosition)(&v27, a2);
((void (__fastcall *)(cocos2d::CCNode *, float32x2_t *))a1->m_areaTransformNode->setPosition)(
a1->m_areaTransformNode,
&v27);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode->setScaleX)(a1->m_areaTransformNode, 1.0);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode->setScaleY)(a1->m_areaTransformNode, 1.0);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode->setSkewX)(a1->m_areaTransformNode, 0.0);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode->setSkewY)(a1->m_areaTransformNode, 0.0);
((void (__fastcall *)(cocos2d::CCNode *, __n128))a1->m_areaTransformNode->setRotation)(a1->m_areaTransformNode, v22);
GJBaseGameLayer::prepareTransformParent(a1, 0);
((void (__fastcall *)(cocos2d::CCAffineTransform *__return_ptr))a1->m_areaTransformNode->nodeToWorldTransform)(&v26);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode2->setScaleX)(a1->m_areaTransformNode2, 1.0);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode2->setScaleY)(a1->m_areaTransformNode2, 1.0);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode2->setSkewX)(a1->m_areaTransformNode2, 0.0);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode2->setSkewY)(a1->m_areaTransformNode2, 0.0);
((void (__fastcall *)(cocos2d::CCNode *, float))a1->m_areaTransformNode2->setRotation)(a1->m_areaTransformNode2, 0.0);
sub_1000229B0(&v25);
if ( a3 )
{
data = a3->data;
num = data->num;
if ( (_DWORD)num )
{
arr = (GameObject **)data->arr;
v12 = (unsigned __int64)&arr[num - 1];
v21 = (float32x4_t)vdupq_lane_s32((int32x2_t)v22.n128_u64[0], 0);
while ( 1 )
{
v13 = *arr;
if ( !*arr )
goto LABEL_28;
if ( !v13->m_unk508 )
break;
LABEL_27:
if ( (unsigned __int64)++arr > v12 )
goto LABEL_28;
}
v14 = GJBaseGameLayer::resetAreaObjectValues(a1, *arr, 1);
v13->m_isDirty = 1;
((void (__fastcall *)(cocos2d::CCAffineTransform *__return_ptr, GameObject *))v13->getRealPosition)(&v24, v13);
sub_1000229D0(&v25, (double *)&v24.a);
m_areaTransformNode2 = a1->m_areaTransformNode2;
*(float32x2_t *)&v16 = sub_1000229F0(&v25, &v27, (float32x2_t *)&v24);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCAffineTransform *, double))m_areaTransformNode2->setPosition)(
m_areaTransformNode2,
&v24,
v16);
((void (__fastcall *)(cocos2d::CCAffineTransform *__return_ptr))a1->m_areaTransformNode2->nodeToParentTransform)(&v23);
cocos2d::CCAffineTransformConcat(&v24, &v23, &v26);
v17 = v24.tx - v25.f32[0];
v18 = v24.ty - v25.f32[1];
v19 = GJBaseGameLayer::resetAreaObjectValues(a1, v13, 1);
if ( v17 == 0.0 && v18 == 0.0 )
{
if ( !v19 )
{
LABEL_18:
v20 = v22;
if ( v22.n128_f32[0] != 0.0 && v13->m_canRotateFree )
{
v20 = (__n128)vaddq_f32(*(float32x4_t *)&v13->m_rotationXOffset, v21);
*(__n128 *)&v13->m_rotationXOffset = v20;
if ( v5 )
((void (__fastcall *)(GameObject *, float))v13->setRRotation)(v13, 0.0);
if ( v13->m_objectType != Decoration && !v13->m_shouldUseOuterOb )
GameObject::calculateOrientedBox(v13);
}
if ( v14 )
((void (__fastcall *)(GJBaseGameLayer *, GameObject *, __n128))a1->updateObjectSection)(a1, v13, v20);
goto LABEL_27;
}
}
else
{
if ( v18 != 0.0 )
{
v13->m_positionY = v13->m_positionY + v18;
v13->m_positionYOffset = v18 + v13->m_positionYOffset;
}
GameObject::dirtifyObjectPos(v13);
GameObject::dirtifyObjectRect(v13);
if ( v17 != 0.0 && !v13->m_tempOffsetXRelated )
{
v13->m_positionXOffset = v17 + v13->m_positionXOffset;
v13->m_positionX = v13->m_positionX + v17;
}
}
((void (__fastcall *)(GJBaseGameLayer *, GameObject *))a1->updateObjectSection)(a1, v13);
goto LABEL_18;
}
}
LABEL_28:
((void (__fastcall *)(GJBaseGameLayer *, cocos2d::CCArray *))a1->updateDisabledObjectsLastPos)(a1, a3);
}