//
// EditorUI::activateRotationControl from 0x39c8bc to 0x39c998 (220 bytes)
//
// 4 xrefs:
// > EditorUI::toggleSpecialEditButtons @ 0x39cac0
// > EditorUI::moveObjectCall @ 0x39f85a
// > EditorUI::undoLastAction @ 0x3a476c
// > EditorUI::redoLastAction @ 0x3a47aa
//
// 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 EditorUI::activateRotationControl(EditorUI *a1, cocos2d::CCObject *a2)
{
int v3; // r2
bool v4; // r3
GJRotationControl *m_rotationControl; // r5
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
const cocos2d::CCPoint *v7; // r0
GJRotationControl *v8; // r5
void (__fastcall *setScale)(cocos2d::CCNode *__hidden, float); // r7
float v10; // r0
cocos2d::CCPoint v11; // [sp+4h] [bp-Ch] BYREF
LODWORD(v11.x) = a2;
if ( (cocos2d::CCArray::count(a1->m_selectedObjects) || a1->m_selectedObject)
&& (!((int (__fastcall *)(GJRotationControl *))a1->m_rotationControl->isVisible)(a1->m_rotationControl)
|| a1->m_canActivateControls) )
{
EditorUI::deactivateTransformControl(a1);
a1->m_canActivateControls = 0;
if ( cocos2d::CCArray::count(a1->m_selectedObjects) )
{
EditorUI::getGroupCenter(&v11, a1, a1->m_selectedObjects, 0);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_pivotPoint, COERCE_FLOAT(&v11), v3, v4);
a1->m_rotationControl->setPosition(a1->m_rotationControl, &a1->m_pivotPoint);
}
else
{
m_rotationControl = a1->m_rotationControl;
setPosition = m_rotationControl->setPosition;
v7 = a1->m_selectedObject->getPosition(a1->m_selectedObject);
setPosition(m_rotationControl, v7);
}
v8 = a1->m_rotationControl;
setScale = v8->setScale;
v10 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLayer *))a1->m_editorLayer->m_objectLayer->getScale)(a1->m_editorLayer->m_objectLayer));
((void (__fastcall *)(GJRotationControl *, _DWORD))setScale)(v8, 1.0 / v10);
a1->m_rotationControl->setVisible(a1->m_rotationControl, 1);
}
}