//
// GJTransformControl::updateButtons from 0x39ed00 to 0x39f64e (2382 bytes)
//
// 12 xrefs:
// > GJTransformControl::refreshControl @ 0x39f6d2
// > GJTransformControl::refreshControl @ 0x39f6dc
// > GJTransformControl::refreshControl @ 0x39f734
// > GJTransformControl::refreshControl @ 0x39f73e
// > GJTransformControl::ccTouchMoved @ 0x39fc6a
// > GJTransformControl::ccTouchEnded @ 0x39fd62
// > GJTransformControl::ccTouchEnded @ 0x39fd72
// > GJTransformControl::ccTouchEnded @ 0x39fdca
// > GJTransformControl::ccTouchEnded @ 0x39fdd4
// > GJTransformControl::applyRotation @ 0x39fe3c
// > EditorUI::transformObjectCall @ 0x39ff2a
// > GJTransformControl::loadValues @ 0x3a0494
//
// 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 GJTransformControl::updateButtons(GJTransformControl *a1, bool a2, bool a3)
{
GJTransformControlDelegate *m_delegate; // r0
GJTransformControlDelegate_vtbl *v5; // r3
EditorUI *v6; // r0
GameManager *v7; // r0
float v8; // s18
float v9; // s17
float v10; // s20
float v11; // s19
GameManager *v12; // r0
const cocos2d::CCPoint *v13; // r0
GameManager *v14; // r0
GameManager *v15; // r0
cocos2d::CCArray *m_objects; // r0
unsigned int v17; // r9
cocos2d::CCNode *v18; // r6
float c; // s21
float d; // s16
float y; // s15
const cocos2d::CCPoint *v22; // r0
int v23; // r2
int v24; // r2
bool v25; // r3
int v26; // r2
bool v27; // r3
int v28; // r2
bool v29; // r3
float x; // s12
float v31; // s11
float v32; // s12
float v33; // s11
float v34; // s10
float v35; // s11
float v36; // s12
float v37; // s11
float v38; // s9
float v39; // s11
float v40; // s9
float v41; // s8
float v42; // s11
const cocos2d::CCPoint *v43; // r0
const cocos2d::CCPoint *v44; // r0
int v45; // r2
GJTransformControlDelegate *v46; // r0
GJTransformControlDelegate_vtbl *v47; // r3
EditorUI *v48; // r0
bool v49; // r3
int v50; // r2
bool v51; // r3
int v52; // r2
bool v53; // r3
int v54; // r2
bool v55; // r3
int v56; // r2
bool v57; // r3
int v58; // r2
bool v59; // r3
cocos2d::CCNode *m_mainNode; // r0
cocos2d::CCNode_vtbl *v61; // r3
float v62; // s15
float v63; // s14
bool v64; // fzf
bool v65; // fnf
float m_scaleX; // s15
bool v67; // nf
bool v68; // fnf
float v69; // s14
float v70; // s15
bool v71; // fzf
bool v72; // fnf
float m_scaleY; // s15
float v74; // r7
float v75; // r6
float v76; // r8
float v77; // s18
float v78; // s17
float v79; // s16
cocos2d::CCSprite *v80; // r10
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v82; // r10
void (__fastcall *v83)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v84; // r10
void (__fastcall *v85)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v86; // r10
void (__fastcall *v87)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v88; // r10
void (__fastcall *v89)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v90; // r10
void (__fastcall *v91)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v92; // r8
void (__fastcall *v93)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v94; // r7
void (__fastcall *v95)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCSprite *v96; // r6
void (__fastcall *v97)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCSprite *v98; // r0
float v99; // r1
cocos2d::CCSprite *v100; // r0
float v101; // s17
cocos2d::CCSprite *v102; // r6
void (__fastcall *v103)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCSprite *v104; // r0
float v105; // r2
cocos2d::CCNode *v106; // r6
void (__fastcall *v107)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
int v108; // r2
bool v109; // r3
cocos2d::CCSprite *v110; // r6
void (__fastcall *v111)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
GameManager *v112; // r0
GameManager *v113; // r0
_BOOL4 v114; // [sp+8h] [bp-8Ch]
_BOOL4 v115; // [sp+Ch] [bp-88h]
int v116; // [sp+10h] [bp-84h]
cocos2d::CCPoint v117; // [sp+2Ch] [bp-68h] BYREF
cocos2d::CCPoint v118; // [sp+34h] [bp-60h] BYREF
cocos2d::CCPoint v119; // [sp+3Ch] [bp-58h] BYREF
cocos2d::CCPoint v120; // [sp+44h] [bp-50h] BYREF
cocos2d::CCPoint v121; // [sp+4Ch] [bp-48h] BYREF
cocos2d::CCPoint v122; // [sp+54h] [bp-40h] BYREF
cocos2d::CCPoint v123; // [sp+5Ch] [bp-38h] BYREF
cocos2d::CCPoint v124; // [sp+64h] [bp-30h] BYREF
cocos2d::CCPoint v125; // [sp+6Ch] [bp-28h] BYREF
cocos2d::CCPoint v126; // [sp+74h] [bp-20h] BYREF
cocos2d::CCRect v127; // [sp+7Ch] [bp-18h] BYREF
m_delegate = a1->m_delegate;
v115 = a3;
v114 = a2;
if ( m_delegate )
{
v5 = m_delegate->__vftable;
if ( a3 )
{
v6 = (EditorUI *)((int (*)(void))v5->getUI)();
EditorUI::transformObjectsReset(v6);
}
else
{
((void (*)(void))v5->transformResetRotation)();
}
}
v7 = GameManager::sharedState();
v8 = 10000000.0;
v9 = -10000000.0;
v10 = 10000000.0;
v11 = -10000000.0;
v116 = ((int (__fastcall *)(cocos2d::CCLayer *))v7->m_levelEditorLayer->m_objectLayer->getScale)(v7->m_levelEditorLayer->m_objectLayer);
v12 = GameManager::sharedState();
v13 = v12->m_levelEditorLayer->m_objectLayer->getPosition(v12->m_levelEditorLayer->m_objectLayer);
cocos2d::CCPoint::CCPoint(&v117, v13);
v14 = GameManager::sharedState();
((void (__fastcall *)(cocos2d::CCLayer *, int))v14->m_levelEditorLayer->m_objectLayer->setScale)(
v14->m_levelEditorLayer->m_objectLayer,
1065353216);
v15 = GameManager::sharedState();
v15->m_levelEditorLayer->m_objectLayer->setPosition(
v15->m_levelEditorLayer->m_objectLayer,
(const cocos2d::CCPoint *)&flt_AC5D38);
m_objects = a1->m_objects;
if ( m_objects && cocos2d::CCArray::count(m_objects) )
{
v17 = 0;
while ( v17 < cocos2d::CCArray::count(a1->m_objects) )
{
v18 = (cocos2d::CCNode *)cocos2d::CCArray::objectAtIndex(a1->m_objects, v17);
cocos2d::CCPoint::CCPoint(&v118, (const cocos2d::CCPoint *)&v18[1].m_obAnchorPointInPoints.y);
c = v18[2].m_sAdditionalTransform.c;
d = v18[2].m_sAdditionalTransform.d;
if ( ((int (__fastcall *)(cocos2d::CCNode *))v18->__vftable[1].removeComponent)(v18) )
{
y = v118.y;
if ( c >= d )
d = c;
if ( v118.x >= v118.y )
y = v118.x;
c = d;
v118.x = y;
v118.y = y;
}
cocos2d::CCRect::CCRect(&v127, 0.0, 0.0, c + v118.x, d + v118.y);
cocos2d::CCPoint::CCPoint(&v126, 0.0, 0.0);
cocos2d::CCNode::convertToWorldSpace(&v119, v18, &v126);
cocos2d::CCPoint::CCPoint(&v126, -(float)(v127.size.width * 0.5), v127.size.height * 0.5);
cocos2d::CCNode::convertToWorldSpace(&v120, v18, &v126);
cocos2d::CCPoint::CCPoint(&v126, v127.size.width * 0.5, v127.size.height * 0.5);
cocos2d::CCNode::convertToWorldSpace(&v121, v18, &v126);
cocos2d::CCPoint::CCPoint(&v126, -(float)(v127.size.width * 0.5), -(float)(v127.size.height * 0.5));
cocos2d::CCNode::convertToWorldSpace(&v122, v18, &v126);
cocos2d::CCPoint::CCPoint(&v126, v127.size.width * 0.5, -(float)(v127.size.height * 0.5));
cocos2d::CCNode::convertToWorldSpace(&v123, v18, &v126);
v22 = v18->getPosition(v18);
cocos2d::CCPoint::CCPoint(&v124, v22);
cocos2d::CCPoint::operator-(&v125, &v120, &v119);
cocos2d::CCPoint::operator+(&v126, &v124, &v125);
cocos2d::CCPoint::operator=((PlayerObject *)&v120, COERCE_FLOAT(&v126), v23, (bool)&v120);
cocos2d::CCPoint::operator-(&v125, &v121, &v119);
cocos2d::CCPoint::operator+(&v126, &v124, &v125);
cocos2d::CCPoint::operator=((PlayerObject *)&v121, COERCE_FLOAT(&v126), v24, v25);
cocos2d::CCPoint::operator-(&v125, &v122, &v119);
cocos2d::CCPoint::operator+(&v126, &v124, &v125);
cocos2d::CCPoint::operator=((PlayerObject *)&v122, COERCE_FLOAT(&v126), v26, v27);
cocos2d::CCPoint::operator-(&v125, &v123, &v119);
cocos2d::CCPoint::operator+(&v126, &v124, &v125);
cocos2d::CCPoint::operator=((PlayerObject *)&v123, COERCE_FLOAT(&v126), v28, v29);
if ( v120.x < v121.x )
x = v121.x;
else
x = v120.x;
if ( x < v122.x )
{
v31 = v122.x;
}
else if ( v120.x < v121.x )
{
v31 = v121.x;
}
else
{
v31 = v120.x;
}
v32 = v123.x;
if ( v31 < v123.x )
{
v34 = v123.x;
}
else
{
if ( v120.x < v121.x )
v33 = v121.x;
else
v33 = v120.x;
if ( v33 < v122.x )
{
v34 = v122.x;
}
else if ( v120.x < v121.x )
{
v34 = v121.x;
}
else
{
v34 = v120.x;
}
}
if ( v120.x > v121.x )
{
if ( v121.x > v122.x )
{
LABEL_38:
v35 = v122.x;
LABEL_39:
if ( v35 <= v123.x )
{
if ( v120.x > v121.x )
v36 = v121.x;
else
v36 = v120.x;
goto LABEL_43;
}
goto LABEL_48;
}
}
else
{
if ( v120.x > v122.x )
goto LABEL_38;
if ( v120.x <= v121.x )
{
v35 = v120.x;
goto LABEL_39;
}
}
if ( v121.x <= v123.x )
{
v36 = v121.x;
LABEL_43:
if ( v36 > v122.x )
{
v32 = v122.x;
}
else if ( v120.x > v121.x )
{
v32 = v121.x;
}
else
{
v32 = v120.x;
}
}
LABEL_48:
if ( v120.y < v121.y )
v37 = v121.y;
else
v37 = v120.y;
if ( v37 < v122.y )
{
v38 = v122.y;
}
else if ( v120.y < v121.y )
{
v38 = v121.y;
}
else
{
v38 = v120.y;
}
v39 = v123.y;
if ( v38 < v123.y )
{
v40 = v123.y;
}
else
{
if ( v120.y < v121.y )
v40 = v121.y;
else
v40 = v120.y;
if ( v40 < v122.y )
v40 = v122.y;
}
if ( v120.y > v121.y )
{
if ( v121.y > v122.y )
{
LABEL_68:
v41 = v122.y;
goto LABEL_69;
}
}
else
{
if ( v120.y > v122.y )
goto LABEL_68;
if ( v120.y <= v121.y )
{
v41 = v120.y;
LABEL_69:
if ( v41 > v123.y )
goto LABEL_78;
if ( v120.y > v121.y )
v42 = v121.y;
else
v42 = v120.y;
goto LABEL_73;
}
}
if ( v121.y > v123.y )
goto LABEL_78;
v42 = v121.y;
LABEL_73:
if ( v42 > v122.y )
{
v39 = v122.y;
}
else if ( v120.y > v121.y )
{
v39 = v121.y;
}
else
{
v39 = v120.y;
}
LABEL_78:
++v17;
if ( v11 < v34 )
v11 = v34;
if ( v10 > v32 )
v10 = v32;
if ( v9 < v40 )
v9 = v40;
if ( v8 > v39 )
v8 = v39;
}
}
cocos2d::CCPoint::CCPoint(&v127.origin, v11, v9);
v43 = a1->getPosition(a1);
cocos2d::CCPoint::operator-(&v123, &v127, v43);
cocos2d::CCPoint::CCPoint(&v127.origin, v10, v8);
v44 = a1->getPosition(a1);
cocos2d::CCPoint::operator-(&v124, &v127, v44);
v46 = a1->m_delegate;
if ( v46 )
{
v47 = v46->__vftable;
if ( v115 )
{
v48 = (EditorUI *)((int (*)(void))v47->getUI)();
EditorUI::transformObjectsActive(v48);
LABEL_92:
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_topRight, COERCE_FLOAT(&v123), v45, v49);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_bottomLeft, COERCE_FLOAT(&v124), v50, v51);
goto LABEL_118;
}
((void (*)(void))v47->transformRestoreRotation)();
}
else
{
v49 = v115;
if ( v115 )
goto LABEL_92;
}
if ( v114 )
{
cocos2d::CCPoint::CCPoint(&v125, &v123);
cocos2d::CCPoint::CCPoint(&v126, &v124);
cocos2d::CCPoint::operator-(&v127, &v123, &v125);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_topRightOrigin, COERCE_FLOAT(&v127), v52, v53);
cocos2d::CCPoint::operator-(&v127, &v124, &v126);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_bottomLeftOrigin, COERCE_FLOAT(&v127), v54, v55);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_topRight, COERCE_FLOAT(&v123), v56, v57);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_bottomLeft, COERCE_FLOAT(&v124), v58, v59);
m_mainNode = a1->m_mainNode;
a1->m_scaleX = 1.0;
a1->m_scaleY = 1.0;
v61 = m_mainNode->__vftable;
a1->m_rotationX = 0.0;
a1->m_rotationY = 0.0;
((void (__fastcall *)(cocos2d::CCNode *))v61->setRotation)(m_mainNode);
}
else
{
v62 = a1->m_topRightOrigin.x;
v63 = a1->m_bottomLeftOrigin.x;
v64 = v62 == 0.0;
v65 = v62 < 0.0;
m_scaleX = a1->m_scaleX;
v67 = v65;
v68 = v63 < 0.0;
if ( !v67 && !v64 )
v123.x = a1->m_scaleX;
if ( v63 < 0.0 )
m_scaleX = -m_scaleX;
v69 = a1->m_bottomLeftOrigin.y;
if ( v68 )
v124.x = m_scaleX;
v70 = a1->m_topRightOrigin.y;
v71 = v70 == 0.0;
v72 = v70 < 0.0;
m_scaleY = a1->m_scaleY;
if ( !v72 && !v71 )
v123.y = a1->m_scaleY;
if ( v69 < 0.0 )
v124.y = -m_scaleY;
}
if ( a1->m_scaleX >= 0.0 )
{
v74 = v124.x;
v75 = v123.x;
}
else
{
v74 = v123.x;
v75 = v124.x;
}
if ( a1->m_scaleY >= 0.0 )
{
v76 = v123.y;
v77 = v124.y;
}
else
{
v76 = v124.y;
v77 = v123.y;
}
v78 = (float)(v123.x - v124.x) * 0.5;
v79 = (float)(v123.y - v124.y) * 0.5;
v80 = GJTransformControl::spriteByTag(a1, 3);
setPosition = v80->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v75, v79 + v124.y);
setPosition(v80, &v127.origin);
v82 = GJTransformControl::spriteByTag(a1, 2);
v83 = v82->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v74, v79 + v124.y);
v83(v82, &v127.origin);
v84 = GJTransformControl::spriteByTag(a1, 4);
v85 = v84->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v78 + v124.x, v76);
v85(v84, &v127.origin);
v86 = GJTransformControl::spriteByTag(a1, 5);
v87 = v86->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v78 + v124.x, v77);
v87(v86, &v127.origin);
v88 = GJTransformControl::spriteByTag(a1, 6);
v89 = v88->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v74, v76);
v89(v88, &v127.origin);
v90 = GJTransformControl::spriteByTag(a1, 7);
v91 = v90->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v75, v76);
v91(v90, &v127.origin);
v92 = GJTransformControl::spriteByTag(a1, 8);
v93 = v92->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v74, v77);
v93(v92, &v127.origin);
v94 = GJTransformControl::spriteByTag(a1, 9);
v95 = v94->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v75, v77);
v95(v94, &v127.origin);
v96 = GJTransformControl::spriteByTag(a1, 10);
v97 = v96->setPosition;
if ( v114 )
{
v99 = 0.0;
}
else
{
v98 = GJTransformControl::spriteByTag(a1, 10);
v99 = v98->getPosition(v98)->x;
}
cocos2d::CCPoint::CCPoint(&v127.origin, v99, v123.y + 30.0);
v97(v96, &v127.origin);
v100 = GJTransformControl::spriteByTag(a1, 11);
v101 = v123.x + 30.0;
v102 = v100;
v103 = v100->setPosition;
if ( v114 )
{
v105 = 0.0;
}
else
{
v104 = GJTransformControl::spriteByTag(a1, 11);
v105 = v104->getPosition(v104)->y;
}
cocos2d::CCPoint::CCPoint(&v127.origin, v101, v105);
v103(v102, &v127.origin);
v106 = a1->m_warpLockButton->getParent(a1->m_warpLockButton);
v107 = v106->setPosition;
cocos2d::CCPoint::CCPoint(&v127.origin, v123.x + 40.0, v123.y + 40.0);
v107(v106, &v127.origin);
cocos2d::CCPoint::CCPoint(&v127.origin, v123.x + 60.0, v77 + v79);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_rotatePosition, COERCE_FLOAT(&v127), v108, v109);
GJTransformControl::calculateRotationOffset(a1);
v110 = GJTransformControl::spriteByTag(a1, 12);
v111 = v110->setPosition;
cocos2d::CCNode::convertToWorldSpace(&v126, a1->m_mainNodeParent, &a1->m_rotatePosition);
cocos2d::CCNode::convertToNodeSpace(&v127.origin, a1, &v126);
v111(v110, &v127.origin);
LABEL_118:
v112 = GameManager::sharedState();
((void (__fastcall *)(cocos2d::CCLayer *, int))v112->m_levelEditorLayer->m_objectLayer->setScale)(
v112->m_levelEditorLayer->m_objectLayer,
v116);
v113 = GameManager::sharedState();
v113->m_levelEditorLayer->m_objectLayer->setPosition(v113->m_levelEditorLayer->m_objectLayer, &v117);
}