//
// GJBaseGameLayer::processRotationActions from 0x47f440 to 0x47f94e (1294 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processMoveActionsStep @ 0x496ce0
//
// 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::processRotationActions(GJBaseGameLayer *a1)
{
const cocos2d::CCPoint *v2; // r0
GJEffectManager *m_effectManager; // r3
std::__detail::_Hash_node_base *i; // r5
std::__detail::_Hash_node_base *M_nxt; // r2
std::__detail::_Hash_node_base *v6; // r0
std::__detail::_Hash_node_base *v7; // t1
GroupCommandObject2 **m_start; // r10
int v9; // r5
int v10; // t1
char v11; // r8
GameObject *MainObject; // r11
cocos2d::CCArray *OptimizedGroup; // r6
cocos2d::CCArray *Group; // r0
float v15; // s14
float v16; // s15
int v17; // r3
int v18; // r1
int v19; // r2
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r5
int v22; // r11
int v23; // t1
cocos2d::ccArray *v24; // r3
int v25; // r6
cocos2d::CCObject **v26; // r3
unsigned int v27; // r5
cocos2d::CCObject **v28; // r8
int v29; // r6
int v30; // t1
float v31; // s14
int v32; // r2
unsigned int m_commandIndex; // r2
float v34; // s14
float v35; // s14
float v36; // s12
float v37; // s13
float v38; // s15
float y; // s12
double v40; // d5
float v41; // s15
float v42; // r1
float v43; // r1
int v44; // r3
cocos2d::CCArray *StaticGroup; // [sp+14h] [bp-80h]
char v46; // [sp+14h] [bp-80h]
int v47; // [sp+18h] [bp-7Ch]
int v48; // [sp+1Ch] [bp-78h]
GroupCommandObject2 **m_finish; // [sp+20h] [bp-74h]
cocos2d::CCObject **v50; // [sp+24h] [bp-70h]
float v51; // [sp+34h] [bp-60h] BYREF
float v52; // [sp+38h] [bp-5Ch] BYREF
cocos2d::CCPoint v53; // [sp+3Ch] [bp-58h] BYREF
cocos2d::CCPoint v54; // [sp+44h] [bp-50h] BYREF
cocos2d::CCPoint v55; // [sp+4Ch] [bp-48h] BYREF
cocos2d::CCPoint v56; // [sp+54h] [bp-40h] BYREF
cocos2d::CCAffineTransform v57; // [sp+5Ch] [bp-38h] BYREF
cocos2d::CCPoint v58[3]; // [sp+74h] [bp-20h] BYREF
v47 = ((int (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getScaleX)(a1->m_objectLayer);
v48 = ((int (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getScaleY)(a1->m_objectLayer);
v2 = a1->m_objectLayer->getPosition(a1->m_objectLayer);
cocos2d::CCPoint::CCPoint(&v53, v2);
((void (__fastcall *)(cocos2d::CCLayer *, int))a1->m_objectLayer->setScale)(a1->m_objectLayer, 1065353216);
a1->m_objectLayer->setPosition(a1->m_objectLayer, &stru_AC68C0);
m_effectManager = a1->m_effectManager;
for ( i = m_effectManager->m_unkMap5c8._M_h._M_before_begin._M_nxt; i; i = i->_M_nxt )
{
M_nxt = i[2]._M_nxt;
v6 = i[3]._M_nxt;
while ( M_nxt != v6 )
{
v7 = M_nxt->_M_nxt;
++M_nxt;
v7[120]._M_nxt = (std::__detail::_Hash_node_base *)a1->m_gameState.m_commandIndex;
}
}
m_start = m_effectManager->m_unkVector5b0.m_start;
m_finish = m_effectManager->m_unkVector5b0.m_finish;
while ( m_start != m_finish )
{
v10 = (int)*m_start++;
v9 = v10;
if ( *(_DWORD *)(v10 + 480) == a1->m_gameState.m_commandIndex )
{
v11 = *(_BYTE *)(v9 + 424);
if ( !v11 )
{
MainObject = GJBaseGameLayer::tryGetMainObject(a1, *(_DWORD *)(v9 + 44));
StaticGroup = GJBaseGameLayer::getStaticGroup(a1, *(_DWORD *)(v9 + 40));
OptimizedGroup = GJBaseGameLayer::getOptimizedGroup(a1, *(_DWORD *)(v9 + 40));
if ( cocos2d::CCArray::count(StaticGroup) )
{
Group = GJBaseGameLayer::getGroup(a1, *(_DWORD *)(v9 + 40));
v15 = *(double *)(v9 + 160) - *(double *)(v9 + 272);
v51 = v15;
OptimizedGroup = Group;
}
else
{
v11 = 1;
v31 = *(double *)(v9 + 168) - *(double *)(v9 + 280);
v51 = v31;
}
v16 = v51;
v17 = *(unsigned __int8 *)(v9 + 184);
v46 = *(_BYTE *)(v9 + 114);
if ( v51 != 0.0 || *(_BYTE *)(v9 + 114) )
{
*(_BYTE *)(v9 + 424) = 1;
if ( v17 )
v16 = 0.0;
v18 = *(_DWORD *)(v9 + 40);
v19 = *(_DWORD *)(v9 + 44);
v52 = v16;
GJBaseGameLayer::claimRotationAction(a1, v18, v19, &v51, &v52, v11, 1);
if ( MainObject )
{
GameObject::getUnmodifiedPosition(&v54, MainObject);
GJBaseGameLayer::claimMoveAction(&v55, a1, *(_DWORD *)(v9 + 40), v11);
a1->m_areaTransformNode->setPosition(a1->m_areaTransformNode, &v54);
((void (__fastcall *)(cocos2d::CCNode *, int))a1->m_areaTransformNode->setScaleX)(
a1->m_areaTransformNode,
1065353216);
((void (__fastcall *)(cocos2d::CCNode *, int))a1->m_areaTransformNode->setScaleY)(
a1->m_areaTransformNode,
1065353216);
((void (__fastcall *)(cocos2d::CCNode *, int))a1->m_areaScaleNode->setScaleX)(
a1->m_areaScaleNode,
1065353216);
((void (__fastcall *)(cocos2d::CCNode *, int))a1->m_areaScaleNode->setScaleY)(
a1->m_areaScaleNode,
1065353216);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))a1->m_areaTransformNode->setSkewX)(
a1->m_areaTransformNode,
0);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))a1->m_areaTransformNode->setSkewY)(
a1->m_areaTransformNode,
0);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))a1->m_areaSkewNode->setSkewX)(a1->m_areaSkewNode, 0);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))a1->m_areaSkewNode->setSkewY)(a1->m_areaSkewNode, 0);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))a1->m_areaTransformNode->setRotation)(
a1->m_areaTransformNode,
LODWORD(v51));
GJBaseGameLayer::prepareTransformParent(a1, 0);
((void (__fastcall *)(cocos2d::CCAffineTransform *))a1->m_areaTransformNode->nodeToWorldTransform)(&v57);
((void (__fastcall *)(cocos2d::CCPoint *))a1->m_areaSkewNode->nodeToWorldTransform)(v58);
((void (__fastcall *)(cocos2d::CCPoint *))a1->m_areaScaleNode->nodeToWorldTransform)(v58);
((void (__fastcall *)(cocos2d::CCNode *, int))a1->m_areaTransformNode2->setScaleX)(
a1->m_areaTransformNode2,
1065353216);
((void (__fastcall *)(cocos2d::CCNode *, int))a1->m_areaTransformNode2->setScaleY)(
a1->m_areaTransformNode2,
1065353216);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))a1->m_areaTransformNode2->setSkewX)(
a1->m_areaTransformNode2,
0);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))a1->m_areaTransformNode2->setSkewY)(
a1->m_areaTransformNode2,
0);
((void (__fastcall *)(cocos2d::CCNode *, _DWORD))a1->m_areaTransformNode2->setRotation)(
a1->m_areaTransformNode2,
0);
a1->m_rotatedCount += cocos2d::CCArray::count(OptimizedGroup);
if ( OptimizedGroup )
{
data = OptimizedGroup->data;
if ( data->num )
{
arr = data->arr;
v50 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v50 )
{
v23 = (int)*arr++;
v22 = v23;
if ( !v23 )
break;
v32 = *(unsigned __int8 *)(v22 + 1102);
*(_BYTE *)(v22 + 1103) = v46;
if ( !v32 )
{
m_commandIndex = a1->m_gameState.m_commandIndex;
if ( *(_DWORD *)(v22 + 1064) != m_commandIndex )
{
v34 = *(double *)(v22 + 800);
*(float *)(v22 + 1052) = v34;
v35 = *(double *)(v22 + 808);
*(float *)(v22 + 1056) = v35;
*(_DWORD *)(v22 + 1064) = m_commandIndex;
GameObject::dirtifyObjectRect((GameObject *)v22);
}
}
v36 = *(float *)(v22 + 568);
*(_BYTE *)(v22 + 700) = 1;
*(_BYTE *)(v22 + 702) = 1;
v37 = *(double *)(v22 + 800) - v36 - v54.x;
v38 = *(double *)(v22 + 808) - *(float *)(v22 + 572) - v54.y;
cocos2d::CCPoint::CCPoint(&v56, v37, v38);
cocos2d::__CCPointApplyAffineTransform(v58, &v56, &v57);
y = v55.y;
v40 = *(double *)(v22 + 808);
*(double *)(v22 + 800) = *(double *)(v22 + 800)
+ (float)(v58[0].x + v55.x)
- *(double *)(v22 + 800)
+ *(float *)(v22 + 568);
*(double *)(v22 + 808) = v40 + (float)(v58[0].y + y) - v40 + *(float *)(v22 + 572);
v41 = v52;
if ( v52 != 0.0 )
{
if ( *(_BYTE *)(v22 + 728) )
{
v42 = v52;
*(float *)(v22 + 576) = *(float *)(v22 + 576) + v52;
*(float *)(v22 + 584) = *(float *)(v22 + 584) + v41;
GameObject::addRotation((GameObject *)v22, v42);
if ( *(_DWORD *)(v22 + 776) != 7 && !*(_BYTE *)(v22 + 636) )
GameObject::calculateOrientedBox((GameObject *)v22);
}
}
a1->updateObjectSection(a1, (GameObject *)v22);
}
}
}
a1->updateDisabledObjectsLastPos(a1, OptimizedGroup);
}
else if ( v52 != 0.0 )
{
if ( OptimizedGroup )
{
v24 = OptimizedGroup->data;
if ( v24->num )
{
v25 = v24->num + 0x40000000;
v26 = v24->arr;
v27 = (unsigned int)&v26[v25 - 1];
v28 = v26;
while ( (unsigned int)v28 <= v27 )
{
v30 = (int)*v28++;
v29 = v30;
if ( !v30 )
break;
if ( *(_BYTE *)(v29 + 728) )
{
v43 = v52;
*(float *)(v29 + 576) = *(float *)(v29 + 576) + v52;
*(float *)(v29 + 584) = *(float *)(v29 + 584) + v43;
GameObject::addRotation((GameObject *)v29, v43);
if ( *(_DWORD *)(v29 + 776) != 7 )
{
v44 = *(unsigned __int8 *)(v29 + 636);
*(_BYTE *)(v29 + 724) = 1;
*(_BYTE *)(v29 + 725) = 1;
if ( !v44 )
GameObject::calculateOrientedBox((GameObject *)v29);
}
}
}
}
}
}
}
}
}
}
((void (__fastcall *)(cocos2d::CCLayer *, int))a1->m_objectLayer->setScaleX)(a1->m_objectLayer, v47);
((void (__fastcall *)(cocos2d::CCLayer *, int))a1->m_objectLayer->setScaleY)(a1->m_objectLayer, v48);
a1->m_objectLayer->setPosition(a1->m_objectLayer, &v53);
}