//
// EditorUI::updateTransformControl from 0x140115400 to 0x1401158e1 (1249 bytes)
//
// 4 xrefs:
// > ??> @ 0x140552e08
// > ??> @ 0x14066f6b8
// > ??> @ 0x14066f72c
// > ??> @ 0x1406c924c
//
// 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::updateTransformControl(EditorUI *a1)
{
double v1; // xmm0_8
unsigned int v3; // ebp
float v4; // xmm7_4
CCMenuItemSpriteExtra *m_deselectBtn; // rcx
cocos2d::CCArray *v6; // rcx
struct cocos2d::CCObject *v7; // rax
CCMenuItemSpriteExtra *v8; // rcx
cocos2d::CCArray *v9; // r14
unsigned int i; // r15d
struct cocos2d::CCObject *v11; // rdi
float *v12; // rbx
__int64 v13; // rax
cocos2d::CCPoint v14; // rax
CCMenuItemSpriteExtra *v15; // rbx
struct cocos2d::CCArray *v16; // r14
GJTransformControl *v17; // r15
cocos2d::CCObject *m_objects; // rcx
struct cocos2d::CCObject *v19; // rdi
float *v20; // rbx
__int64 v21; // rax
GJTransformControl *v22; // rbx
cocos2d::CCNode *m_mainNode; // rcx
GJTransformControlDelegate *m_delegate; // rcx
_BYTE v25[16]; // [rsp+50h] [rbp-68h] BYREF
cocos2d::CCPoint v26; // [rsp+C0h] [rbp+8h] BYREF
if ( !(*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_bReorderChildDirty + 328LL))(*(_QWORD *)&a1->m_bReorderChildDirty) )
return;
v3 = 0;
v4 = 0.0;
a1->m_fSkewY = 1.0;
a1->m_obAnchorPointInPoints = (cocos2d::CCPoint)1065353216LL;
a1->m_obAnchorPoint = 0;
a1->m_obContentSize.width = 0.0;
*(_QWORD *)&a1->m_sAdditionalTransform.b = 0;
*(_QWORD *)&a1->m_sAdditionalTransform.d = 0;
a1->m_sTransform.d = 1.0;
a1->m_sTransform.tx = 1.0;
if ( LOBYTE(a1->m_sAdditionalTransform.a) )
{
m_deselectBtn = a1->m_deselectBtn;
LOBYTE(a1->m_sAdditionalTransform.a) = 0;
if ( m_deselectBtn )
{
m_deselectBtn->getRotation(m_deselectBtn);
goto LABEL_8;
}
v6 = *(cocos2d::CCArray **)&a1->m_nTouchPriority;
if ( v6 && cocos2d::CCArray::count(v6) )
{
v7 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&a1->m_nTouchPriority, 0);
v1 = ((double (__fastcall *)(struct cocos2d::CCObject *))v7->__vftable[4].getTag)(v7);
LABEL_8:
v4 = *(float *)&v1;
if ( *(float *)&v1 != 0.0 )
{
v8 = a1->m_deselectBtn;
if ( v8 )
v9 = cocos2d::CCArray::createWithObject(v8);
else
v9 = *(cocos2d::CCArray **)&a1->m_nTouchPriority;
if ( v9 )
{
if ( cocos2d::CCArray::count(v9) )
{
for ( i = 0; i < cocos2d::CCArray::count(v9); ++i )
{
v11 = cocos2d::CCArray::objectAtIndex(v9, i);
GameObject::updateStartPos((GameObject *)v11);
LODWORD(v26.x) = v11[16].m_eObjType;
v12 = *(float **)sub_14012CF70(&a1->m_uAutoReleaseCount, v25, &v26);
v13 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v11->__vftable[2].getTag)(v11);
cocos2d::CCPoint::operator=(v12 + 5, v13);
v12[7] = *(float *)&v11[20].m_unknown2 / *(float *)&v11[23].m_uIndexInArray;
v12[8] = *(float *)&v11[20].m_nZOrder / *(float *)&v11[23].m_uUnknown;
v12[9] = ((float (__fastcall *)(struct cocos2d::CCObject *))v11->__vftable[5].copyWithZone)(v11);
v12[10] = ((float (__fastcall *)(struct cocos2d::CCObject *))v11->__vftable[5].isEqual)(v11);
}
}
}
cocos2d::CCPoint::CCPoint(&v26, (const struct cocos2d::CCPoint *)&a1->m_pActionManager);
EditorUI::transformObjects((EditorUI *)((char *)a1 - 440), v9, v14, 1.0, 1.0, -v4, -v4, 0.0, 0.0);
}
}
}
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_nUpdateScriptHandler + 120LL))(*(_QWORD *)&a1->m_nUpdateScriptHandler);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_nUpdateScriptHandler + 136LL))(*(_QWORD *)&a1->m_nUpdateScriptHandler);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_nUpdateScriptHandler + 352LL))(*(_QWORD *)&a1->m_nUpdateScriptHandler);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_nUpdateScriptHandler + 368LL))(*(_QWORD *)&a1->m_nUpdateScriptHandler);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_nUpdateScriptHandler + 240LL))(*(_QWORD *)&a1->m_nUpdateScriptHandler);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_nUpdateScriptHandler + 256LL))(*(_QWORD *)&a1->m_nUpdateScriptHandler);
v15 = a1->m_deselectBtn;
v16 = *(struct cocos2d::CCArray **)&a1->m_nTouchPriority;
v17 = *(GJTransformControl **)&a1->m_bReorderChildDirty;
if ( v15 && (!v16 || !cocos2d::CCArray::count(*(cocos2d::CCArray **)&a1->m_nTouchPriority)) )
v16 = cocos2d::CCArray::createWithObject(v15);
m_objects = v17->m_objects;
if ( m_objects )
cocos2d::CCObject::release(m_objects);
v17->m_objects = v16;
cocos2d::CCObject::retain(v16);
if ( v16 && cocos2d::CCArray::count(v16) && cocos2d::CCArray::count(v16) )
{
do
{
v19 = cocos2d::CCArray::objectAtIndex(v16, v3);
GameObject::updateStartPos((GameObject *)v19);
LODWORD(v26.x) = v19[16].m_eObjType;
v20 = *(float **)sub_14012CF70(&a1->m_uAutoReleaseCount, v25, &v26);
v21 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v19->__vftable[2].getTag)(v19);
cocos2d::CCPoint::operator=(v20 + 5, v21);
v20[7] = *(float *)&v19[20].m_unknown2 / *(float *)&v19[23].m_uIndexInArray;
v20[8] = *(float *)&v19[20].m_nZOrder / *(float *)&v19[23].m_uUnknown;
v20[9] = ((float (__fastcall *)(struct cocos2d::CCObject *))v19->__vftable[5].copyWithZone)(v19);
v20[10] = ((float (__fastcall *)(struct cocos2d::CCObject *))v19->__vftable[5].isEqual)(v19);
++v3;
}
while ( v3 < cocos2d::CCArray::count(v16) );
}
GJTransformControl::updateButtons(v17, 1, 0);
if ( v4 != 0.0 )
{
v22 = *(GJTransformControl **)&a1->m_bReorderChildDirty;
if ( v4 != v22->m_rotationY )
{
m_mainNode = v22->m_mainNode;
v22->m_rotationY = v4;
((void (__fastcall *)(cocos2d::CCNode *))m_mainNode->setRotation)(m_mainNode);
m_delegate = v22->m_delegate;
if ( m_delegate )
((void (__fastcall *)(GJTransformControlDelegate *))m_delegate->transformRotationChanged)(m_delegate);
}
GJTransformControl::updateButtons(v22, 0, 0);
}
}