//
// GJBaseGameLayer::rotateObjects from 0x14022c1a0 to 0x14022c676 (1238 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x14023046e
// > ??> @ 0x140680958
// > ??> @ 0x1406809e8
// > ??> @ 0x1406cdbfc
//
// 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::rotateObjects(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
float a3,
cocos2d::CCPoint a4,
cocos2d::CCPoint a5,
bool a6,
bool a7)
{
cocos2d::ccArray *data; // rsi
__int64 num; // rax
cocos2d::CCObject **arr; // rsi
cocos2d::CCObject **i; // r14
cocos2d::CCObject *v14; // rbx
double v15; // xmm1_8
double v16; // xmm0_8
float v17; // xmm1_4
struct cocos2d::CCAffineTransform *v18; // rax
const struct cocos2d::CCAffineTransform *v19; // r9
struct cocos2d::CCAffineTransform *v20; // rax
float v21; // xmm1_4
GJBaseGameLayer *v22; // rcx
cocos2d::CCPoint v23; // [rsp+20h] [rbp-F8h] BYREF
char v24[8]; // [rsp+28h] [rbp-F0h] BYREF
cocos2d::CCPoint v25; // [rsp+30h] [rbp-E8h] BYREF
char v26[24]; // [rsp+38h] [rbp-E0h] BYREF
_BYTE v27[24]; // [rsp+50h] [rbp-C8h] BYREF
struct cocos2d::CCAffineTransform v28; // [rsp+68h] [rbp-B0h] BYREF
char v29[24]; // [rsp+80h] [rbp-98h] BYREF
if ( a2 )
{
a1->m_objectLayer->getScaleX(a1->m_objectLayer);
a1->m_objectLayer->getScaleY(a1->m_objectLayer);
a1->m_objectLayer->getPosition_0(a1->m_objectLayer);
cocos2d::CCPoint::CCPoint(&v25);
((void (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->setScale_0)(a1->m_objectLayer);
a1->m_objectLayer->setPosition_0(a1->m_objectLayer, (const cocos2d::CCPoint *)&dword_1406C1D28);
a1->m_areaTransformNode->setPosition_0(a1->m_areaTransformNode, (const cocos2d::CCPoint *)a4);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode->setScaleX)(a1->m_areaTransformNode);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode->setScaleY)(a1->m_areaTransformNode);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaScaleNode->setScaleX)(a1->m_areaScaleNode);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaScaleNode->setScaleY)(a1->m_areaScaleNode);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode->setSkewX)(a1->m_areaTransformNode);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode->setSkewY)(a1->m_areaTransformNode);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaSkewNode->setSkewX)(a1->m_areaSkewNode);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaSkewNode->setSkewY)(a1->m_areaSkewNode);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode->setRotation)(a1->m_areaTransformNode);
cocos2d::CCObject::retain(a1->m_areaTransformNode2);
a1->m_areaTransformNode2->removeFromParentAndCleanup(a1->m_areaTransformNode2, 0);
a1->m_areaTransformNode->addChild_1(a1->m_areaTransformNode, a1->m_areaTransformNode2);
cocos2d::CCObject::release(a1->m_areaTransformNode2);
a1->m_areaTransformNode->nodeToWorldTransform(
(cocos2d::CCAffineTransform *)a1->m_areaTransformNode,
(cocos2d::CCNode *)&v28);
a1->m_areaSkewNode->nodeToWorldTransform((cocos2d::CCAffineTransform *)a1->m_areaSkewNode, (cocos2d::CCNode *)v27);
a1->m_areaScaleNode->nodeToWorldTransform((cocos2d::CCAffineTransform *)a1->m_areaScaleNode, (cocos2d::CCNode *)v27);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode2->setScaleX)(a1->m_areaTransformNode2);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode2->setScaleY)(a1->m_areaTransformNode2);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode2->setSkewX)(a1->m_areaTransformNode2);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode2->setSkewY)(a1->m_areaTransformNode2);
((void (__fastcall *)(cocos2d::CCNode *))a1->m_areaTransformNode2->setRotation)(a1->m_areaTransformNode2);
cocos2d::CCPoint::CCPoint(&v23);
data = a2->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
v14 = *arr;
if ( !*arr )
break;
v15 = *(double *)&v14[17].__vftable;
v16 = *(float *)&v14[12].__vftable;
HIBYTE(v14[23].m_uID) = 0;
*(float *)&v16 = v15 - v16;
v23.x = *(float *)&v16;
v23.y = *(double *)&v14[17].m_uID - *((float *)&v14[12].__vftable + 1);
if ( !BYTE2(v14[23].m_uID) && v14[22].m_nLuaID != a1->m_gameState.m_commandIndex )
{
v17 = *(double *)&v14[17].m_uID;
*(float *)&v14[22].__vftable = *(double *)&v14[17].__vftable;
*((float *)&v14[22].__vftable + 1) = v17;
v14[22].m_nLuaID = a1->m_gameState.m_commandIndex;
LOWORD(v14[15].m_uIndexInArray) = 257;
}
LOBYTE(v14[15].m_uID) = 1;
BYTE2(v14[15].m_uID) = 1;
((void (__fastcall *)(_QWORD, _QWORD, _QWORD))cocos2d::CCPoint::operator-)(&v23, v24, a4);
a1->m_areaTransformNode2->setPosition_0(a1->m_areaTransformNode2, (const cocos2d::CCPoint *)v24);
v18 = a1->m_areaTransformNode2->nodeToParentTransform(a1->m_areaTransformNode2, v29);
v20 = cocos2d::CCAffineTransformConcat((cocos2d *)v26, v18, &v28, v19);
v21 = _mm_shuffle_ps((__m128)*(unsigned __int64 *)&v20->tx, (__m128)*(unsigned __int64 *)&v20->tx, 85).m128_f32[0];
*(double *)&v14[17].__vftable = (float)((float)(COERCE_FLOAT(*(_QWORD *)&v20->tx) + **(float **)&a5) - v23.x)
+ *(double *)&v14[17].__vftable;
*(double *)&v14[17].m_uID = (float)((float)(v21 + *(float *)(*(_QWORD *)&a5 + 4LL)) - v23.y)
+ *(double *)&v14[17].m_uID;
GJBaseGameLayer::rotateObject(v22, (GameObject *)v14, a3);
a1->updateObjectSection(a1, (GameObject *)v14);
}
}
a1->updateDisabledObjectsLastPos(a1, a2);
((void (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->setScaleX)(a1->m_objectLayer);
((void (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->setScaleY)(a1->m_objectLayer);
a1->m_objectLayer->setPosition_0(a1->m_objectLayer, &v25);
}
}