//
// GJBaseGameLayer::rotateObjects from 0x8628ec to 0x862dd0 (1252 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x883fdc
// > ??> @ 0xba090
//
// 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::rotateObjects(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
float a3,
cocos2d::CCPoint a4,
cocos2d::CCPoint a5,
bool a6,
bool a7)
{
bool v7; // w4
_BOOL8 v10; // x21
float *v11; // x27
float v13; // s9
float v14; // s10
const cocos2d::CCPoint *v15; // x0
cocos2d::ccArray *data; // x1
GameObject **arr; // x26
GameObject *i; // x28
float m_positionYOffset; // s0
_BOOL4 m_isDecoration2; // w0
double m_positionXOffset; // d1
double m_positionX; // d2
double m_positionY; // d3
float v24; // s0
unsigned int m_commandIndex; // w0
float v26; // s2
float v27; // s3
cocos2d::CCNode *m_areaTransformNode2; // x23
cocos2d::CCNode_vtbl *v29; // x9
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
double v31; // d1
GameObject **v33; // [xsp+90h] [xbp+90h]
bool v34; // [xsp+A4h] [xbp+A4h]
_BOOL8 v35; // [xsp+A8h] [xbp+A8h]
cocos2d::CCPoint v36; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::CCPoint v37; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCAffineTransform v38; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCAffineTransform v39; // [xsp+D8h] [xbp+D8h] BYREF
cocos2d::CCAffineTransform v40; // [xsp+F0h] [xbp+F0h] BYREF
v10 = a6;
v35 = a6;
v11 = (float *)a7;
v34 = v7;
if ( a2 )
{
v13 = ((float (__fastcall *)(cocos2d::CCLayer *, float, long double, long double, long double, long double))a1->m_objectLayer->getScaleX)(
a1->m_objectLayer,
a3,
*(long double *)&a4.x,
*(long double *)&a4.y,
*(long double *)&a5.x,
*(long double *)&a5.y);
v14 = a1->m_objectLayer->getScaleY(a1->m_objectLayer);
v15 = a1->m_objectLayer->getPosition(a1->m_objectLayer);
cocos2d::CCPoint::CCPoint(&v36, v15);
a1->m_objectLayer->setScale(a1->m_objectLayer, 1.0);
a1->m_objectLayer->setPosition(a1->m_objectLayer, &stru_1242DA8);
a1->m_areaTransformNode->setPosition(a1->m_areaTransformNode, (const cocos2d::CCPoint *)v10);
a1->m_areaTransformNode->setScaleX(a1->m_areaTransformNode, 1.0);
a1->m_areaTransformNode->setScaleY(a1->m_areaTransformNode, 1.0);
a1->m_areaScaleNode->setScaleX(a1->m_areaScaleNode, 1.0);
a1->m_areaScaleNode->setScaleY(a1->m_areaScaleNode, 1.0);
a1->m_areaTransformNode->setSkewX(a1->m_areaTransformNode, 0.0);
a1->m_areaTransformNode->setSkewY(a1->m_areaTransformNode, 0.0);
a1->m_areaSkewNode->setSkewX(a1->m_areaSkewNode, 0.0);
a1->m_areaSkewNode->setSkewY(a1->m_areaSkewNode, 0.0);
a1->m_areaTransformNode->setRotation(a1->m_areaTransformNode, a3);
GJBaseGameLayer::prepareTransformParent(a1, 0);
a1->m_areaTransformNode->nodeToWorldTransform(&v38, a1->m_areaTransformNode);
a1->m_areaSkewNode->nodeToWorldTransform(&v40, a1->m_areaSkewNode);
a1->m_areaScaleNode->nodeToWorldTransform(&v40, a1->m_areaScaleNode);
a1->m_areaTransformNode2->setScaleX(a1->m_areaTransformNode2, 1.0);
a1->m_areaTransformNode2->setScaleY(a1->m_areaTransformNode2, 1.0);
a1->m_areaTransformNode2->setSkewX(a1->m_areaTransformNode2, 0.0);
a1->m_areaTransformNode2->setSkewY(a1->m_areaTransformNode2, 0.0);
a1->m_areaTransformNode2->setRotation(a1->m_areaTransformNode2, 0.0);
cocos2d::CCPoint::CCPoint(&v37);
data = a2->data;
if ( data->num )
{
arr = (GameObject **)data->arr;
v33 = &arr[data->num - 1];
if ( arr <= v33 )
{
for ( i = *arr; *arr; i = *arr )
{
m_positionYOffset = i->m_positionYOffset;
m_isDecoration2 = i->m_isDecoration2;
m_positionXOffset = i->m_positionXOffset;
i->m_unk4fb = v34;
m_positionX = i->m_positionX;
m_positionY = i->m_positionY;
*(float *)&m_positionXOffset = m_positionX - m_positionXOffset;
v24 = m_positionY - m_positionYOffset;
v37.x = *(float *)&m_positionXOffset;
v37.y = v24;
if ( !m_isDecoration2 )
{
m_commandIndex = a1->m_gameState.m_commandIndex;
if ( i->m_unk4C4 != m_commandIndex )
{
v26 = m_positionX;
i->m_unk4C4 = m_commandIndex;
v27 = m_positionY;
i->m_lastPosition.x = v26;
i->m_lastPosition.y = v27;
GameObject::dirtifyObjectRect(i);
}
}
m_areaTransformNode2 = a1->m_areaTransformNode2;
i->m_isDirty = 1;
++arr;
v29 = m_areaTransformNode2->__vftable;
i->m_isUnmodifiedPosDirty = 1;
setPosition = v29->setPosition;
cocos2d::CCPoint::operator-(&v40, &v37, v35);
setPosition(m_areaTransformNode2, (const cocos2d::CCPoint *)&v40);
a1->m_areaTransformNode2->nodeToParentTransform(&v40, a1->m_areaTransformNode2);
cocos2d::CCAffineTransformConcat(&v39, &v40, &v38);
v31 = i->m_positionY + (float)((float)(v39.ty + v11[1]) - v37.y);
i->m_positionX = i->m_positionX + (float)((float)(v39.tx + *v11) - v37.x);
i->m_positionY = v31;
GJBaseGameLayer::rotateObject(a1, i, a3);
a1->updateObjectSection(a1, i);
if ( v33 < arr )
break;
}
}
}
a1->updateDisabledObjectsLastPos(a1, a2);
a1->m_objectLayer->setScaleX(a1->m_objectLayer, v13);
a1->m_objectLayer->setScaleY(a1->m_objectLayer, v14);
a1->m_objectLayer->setPosition(a1->m_objectLayer, &v36);
}
}