{"type": "func", "start": 3790868, "end": 3791166, "name": "EditorUI::activateTransformControl", "pseudocode": "// \n// EditorUI::activateTransformControl from 0x39d814 to 0x39d93e (298 bytes)\n// \n// 1 xrefs:\n// > EditorUI::keyDown @ 0x3a72d8\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid EditorUI::activateTransformControl(EditorUI *a1, cocos2d::CCObject *a2)\n{\n  cocos2d::CCPoint *p_m_pivotPoint; // r6\n  int v4; // r2\n  bool v5; // r3\n  PlayerObject *v6; // r0\n  cocos2d::CCPoint *v7; // r1\n  GJTransformControl *m_transformControl; // r8\n  float v9; // r0\n  GJTransformControl *v10; // r4\n  int v11; // r0\n  cocos2d::CCPoint v12; // r1\n  cocos2d::CCPoint v13; // [sp+4h] [bp-Ch] BYREF\n\n  LODWORD(v13.x) = a2;\n  if ( cocos2d::CCArray::count(a1->m_selectedObjects) || a1->m_selectedObject )\n  {\n    EditorUI::deactivateScaleControl(a1);\n    EditorUI::deactivateRotationControl(a1);\n    if ( ((int (__fastcall *)(GJTransformControl *))a1->m_transformControl->isVisible)(a1->m_transformControl) )\n    {\n      EditorUI::deactivateTransformControl(a1);\n    }\n    else if ( !((int (__fastcall *)(GJTransformControl *))a1->m_transformControl->isVisible)(a1->m_transformControl)\n           || a1->m_canActivateControls )\n    {\n      a1->m_transformState.m_transformReset = 1;\n      p_m_pivotPoint = &a1->m_pivotPoint;\n      EditorUI::updateEditButtonColor(a1, 31, (cocos2d::ccColor3B)-5855578);\n      a1->m_canActivateControls = 0;\n      if ( cocos2d::CCArray::count(a1->m_selectedObjects) )\n      {\n        EditorUI::getGroupCenter(&v13, a1, a1->m_selectedObjects, 0);\n        v6 = (PlayerObject *)&a1->m_pivotPoint;\n        v7 = &v13;\n      }\n      else\n      {\n        v7 = (cocos2d::CCPoint *)a1->m_selectedObject->getPosition(a1->m_selectedObject);\n        v6 = (PlayerObject *)&a1->m_pivotPoint;\n      }\n      cocos2d::CCPoint::operator=(v6, *(float *)&v7, v4, v5);\n      a1->m_transformControl->setPosition(a1->m_transformControl, &a1->m_pivotPoint);\n      m_transformControl = a1->m_transformControl;\n      v9 = a1->m_editorLayer->m_objectLayer->getScale(a1->m_editorLayer->m_objectLayer);\n      GJTransformControl::scaleButtons(m_transformControl, 1.0 / v9);\n      a1->m_transformControl->setVisible(a1->m_transformControl, 1);\n      v10 = a1->m_transformControl;\n      v11 = (int)v10->getPosition(v10);\n      cocos2d::CCPoint::operator-(&v13, p_m_pivotPoint, v11);\n      LODWORD(v12.x) = &v13;\n      GJTransformControl::updateAnchorSprite(v10, v12);\n    }\n  }\n}", "assembly": "; \n; EditorUI::activateTransformControl from 0x39d814 to 0x39d93e (298 bytes)\n; \n; 1 xrefs:\n; > EditorUI::keyDown @ 0x3a72d8\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nPUSH.W          {R0-R8,LR}                                             ; +0x0, 0x39d814\nMOV             R4, R0                                                 ; +0x4, 0x39d818\nLDR             R7, =(__stack_chk_guard_ptr - 0x39D824)                ; +0x6, 0x39d81a\nLDR.W           R0, [R0,#0x260]; this                                  ; +0x8, 0x39d81c\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0xc, 0x39d820\nLDR             R7, [R7]; __stack_chk_guard                            ; +0xe, 0x39d822\nLDR             R3, [R7]                                               ; +0x10, 0x39d824\nSTR             R3, [SP,#0x10+var_4]                                   ; +0x12, 0x39d826\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x14, 0x39d828\nCBNZ            R0, loc_39D836                                         ; +0x18, 0x39d82c\nLDR.W           R3, [R4,#0x374]                                        ; +0x1a, 0x39d82e\nCMP             R3, #0                                                 ; +0x1e, 0x39d832\nBEQ             loc_39D92C                                             ; +0x20, 0x39d834\nMOV             R0, R4; this                                           ; +0x22, 0x39d836\nBL              _ZN8EditorUI22deactivateScaleControlEv; EditorUI::deactivateScaleControl(void) ; +0x24, 0x39d838\nMOV             R0, R4; this                                           ; +0x28, 0x39d83c\nBL              _ZN8EditorUI25deactivateRotationControlEv; EditorUI::deactivateRotationControl(void) ; +0x2a, 0x39d83e\nLDR.W           R0, [R4,#0x218]                                        ; +0x2e, 0x39d842\nLDR             R3, [R0]                                               ; +0x32, 0x39d846\nLDR.W           R3, [R3,#0xA8]                                         ; +0x34, 0x39d848\nBLX             R3                                                     ; +0x38, 0x39d84c\nCBZ             R0, loc_39D858                                         ; +0x3a, 0x39d84e\nMOV             R0, R4; this                                           ; +0x3c, 0x39d850\nBL              _ZN8EditorUI26deactivateTransformControlEv; EditorUI::deactivateTransformControl(void) ; +0x3e, 0x39d852\nB               loc_39D92C                                             ; +0x42, 0x39d856\nLDR.W           R0, [R4,#0x218]                                        ; +0x44, 0x39d858\nLDR             R3, [R0]                                               ; +0x48, 0x39d85c\nLDR.W           R3, [R3,#0xA8]                                         ; +0x4a, 0x39d85e\nBLX             R3                                                     ; +0x4e, 0x39d862\nCBZ             R0, loc_39D86E                                         ; +0x50, 0x39d864\nLDRB.W          R3, [R4,#0x210]                                        ; +0x52, 0x39d866\nCMP             R3, #0                                                 ; +0x56, 0x39d86a\nBEQ             loc_39D92C                                             ; +0x58, 0x39d86c\nLDR             R1, =(word_9AA83C - 0x39D87C)                          ; +0x5a, 0x39d86e\nMOVS            R3, #1                                                 ; +0x5c, 0x39d870\nSTRB.W          R3, [R4,#0x190]                                        ; +0x5e, 0x39d872\nMOV             R0, R4                                                 ; +0x62, 0x39d876\nADD             R1, PC; word_9AA83C                                    ; +0x64, 0x39d878\nMOV.W           R8, #0                                                 ; +0x66, 0x39d87a\nADD             R5, SP, #0x10+var_C                                    ; +0x6a, 0x39d87e\nADD.W           R6, R4, #0x208                                         ; +0x6c, 0x39d880\nLDRB            R2, [R1,#(word_9AA83F+1 - 0x9AA83C)]                   ; +0x70, 0x39d884\nLDRB            R3, [R1,#(word_9AA83F - 0x9AA83C)]                     ; +0x72, 0x39d886\nORR.W           R3, R3, R2,LSL#8                                       ; +0x74, 0x39d888\nLDRB            R2, [R1,#(byte_9AA841 - 0x9AA83C)]                     ; +0x78, 0x39d88c\nMOVS            R1, #0x1F                                              ; +0x7a, 0x39d88e\nORR.W           R2, R3, R2,LSL#16                                      ; +0x7c, 0x39d890\nBL              _ZN8EditorUI21updateEditButtonColorEiN7cocos2d10_ccColor3BE; EditorUI::updateEditButtonColor(int,cocos2d::_ccColor3B) ; +0x80, 0x39d894\nSTRB.W          R8, [R4,#0x210]                                        ; +0x84, 0x39d898\nLDR.W           R0, [R4,#0x260]; this                                  ; +0x88, 0x39d89c\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x8c, 0x39d8a0\nCBZ             R0, loc_39D8BA                                         ; +0x90, 0x39d8a4\nMOV             R0, R5; this                                           ; +0x92, 0x39d8a6\nMOV             R1, R4; cocos2d::CCArray *                             ; +0x94, 0x39d8a8\nLDR.W           R2, [R4,#0x260]; cocos2d::CCArray *                    ; +0x96, 0x39d8aa\nMOV             R3, R8                                                 ; +0x9a, 0x39d8ae\nBL              _ZN8EditorUI14getGroupCenterEPN7cocos2d7CCArrayEb; EditorUI::getGroupCenter(cocos2d::CCArray *,bool) ; +0x9c, 0x39d8b0\nMOV             R0, R6                                                 ; +0xa0, 0x39d8b4\nMOV             R1, R5                                                 ; +0xa2, 0x39d8b6\nB               loc_39D8C8                                             ; +0xa4, 0x39d8b8\nLDR.W           R0, [R4,#0x374]                                        ; +0xa6, 0x39d8ba\nLDR             R3, [R0]                                               ; +0xaa, 0x39d8be\nLDR             R3, [R3,#0x60]                                         ; +0xac, 0x39d8c0\nBLX             R3                                                     ; +0xae, 0x39d8c2\nMOV             R1, R0                                                 ; +0xb0, 0x39d8c4\nMOV             R0, R6                                                 ; +0xb2, 0x39d8c6\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0xb4, 0x39d8c8\nLDR.W           R0, [R4,#0x218]                                        ; +0xb8, 0x39d8cc\nMOV             R1, R6                                                 ; +0xbc, 0x39d8d0\nLDR             R3, [R0]                                               ; +0xbe, 0x39d8d2\nLDR             R3, [R3,#0x5C]                                         ; +0xc0, 0x39d8d4\nBLX             R3                                                     ; +0xc2, 0x39d8d6\nLDR.W           R3, [R4,#0x340]                                        ; +0xc4, 0x39d8d8\nLDR.W           R8, [R4,#0x218]                                        ; +0xc8, 0x39d8dc\nLDR.W           R0, [R3,#0x9F0]                                        ; +0xcc, 0x39d8e0\nLDR             R3, [R0]                                               ; +0xd0, 0x39d8e4\nLDR             R3, [R3,#0x54]                                         ; +0xd2, 0x39d8e6\nBLX             R3                                                     ; +0xd4, 0x39d8e8\nVMOV.F32        S15, #1.0                                              ; +0xd6, 0x39d8ea\nVMOV            S14, R0                                                ; +0xda, 0x39d8ee\nMOV             R0, R8; this                                           ; +0xde, 0x39d8f2\nVDIV.F32        S15, S15, S14                                          ; +0xe0, 0x39d8f4\nVMOV            R1, S15; float                                         ; +0xe4, 0x39d8f8\nBL              _ZN18GJTransformControl12scaleButtonsEf; GJTransformControl::scaleButtons(float) ; +0xe8, 0x39d8fc\nLDR.W           R0, [R4,#0x218]                                        ; +0xec, 0x39d900\nMOVS            R1, #1                                                 ; +0xf0, 0x39d904\nLDR             R3, [R0]                                               ; +0xf2, 0x39d906\nLDR.W           R3, [R3,#0xA4]                                         ; +0xf4, 0x39d908\nBLX             R3                                                     ; +0xf8, 0x39d90c\nLDR.W           R4, [R4,#0x218]                                        ; +0xfa, 0x39d90e\nLDR             R3, [R4]                                               ; +0xfe, 0x39d912\nMOV             R0, R4                                                 ; +0x100, 0x39d914\nLDR             R3, [R3,#0x60]                                         ; +0x102, 0x39d916\nBLX             R3                                                     ; +0x104, 0x39d918\nMOV             R1, R6                                                 ; +0x106, 0x39d91a\nMOV             R2, R0                                                 ; +0x108, 0x39d91c\nMOV             R0, R5                                                 ; +0x10a, 0x39d91e\nBL              _ZNK7cocos2d7CCPointmiERKS0_; cocos2d::CCPoint::operator-(cocos2d::CCPoint const&) ; +0x10c, 0x39d920\nMOV             R0, R4                                                 ; +0x110, 0x39d924\nMOV             R1, R5                                                 ; +0x112, 0x39d926\nBL              _ZN18GJTransformControl18updateAnchorSpriteEN7cocos2d7CCPointE; GJTransformControl::updateAnchorSprite(cocos2d::CCPoint) ; +0x114, 0x39d928\nLDR             R2, [SP,#0x10+var_4]                                   ; +0x118, 0x39d92c\nLDR             R3, [R7]                                               ; +0x11a, 0x39d92e\nCMP             R2, R3                                                 ; +0x11c, 0x39d930\nBEQ             loc_39D938                                             ; +0x11e, 0x39d932\nBLX             __stack_chk_fail                                       ; +0x120, 0x39d934\nADD             SP, SP, #0x10                                          ; +0x124, 0x39d938\nPOP.W           {R4-R8,PC}                                             ; +0x126, 0x39d93a", "xrefs": ["EditorUI::keyDown @ 0x3a72d8"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}