{"type": "func", "start": 4297417528, "end": 4297418080, "name": "GameObject::addColorSpriteToParent", "pseudocode": "// \n// GameObject::addColorSpriteToParent from 0x100256338 to 0x100256560 (552 bytes)\n// \n// 3 xrefs:\n// > PlayLayer::updateVisibility @ 0x10011c904\n// > GameObject::activateObject @ 0x1002562b8\n// > LevelEditorLayer::updateVisibility @ 0x10035e9c4\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 __fastcall GameObject::addColorSpriteToParent(GameObject *a1, bool a2)\n{\n  cocos2d::CCSprite *m_colorSprite; // x22\n  _BOOL4 m_shouldBlendDetail; // w8\n  _BOOL4 v5; // w20\n  _BOOL4 m_colorSpriteLocked; // w24\n  ZLayer m_zLayer; // w21\n  cocos2d::CCSprite *v8; // x22\n  cocos2d::CCSprite *v9; // x22\n  cocos2d::CCSprite *v10; // x22\n  bool v11; // w22\n  int ParentMode; // w23\n  _BOOL4 m_editorEnabled; // w25\n  GameManager *v14; // x0\n  __int64 v15; // x8\n  cocos2d::CCNode *v16; // x21\n  cocos2d::CCSprite *v17; // x20\n  __int64 v18; // x1\n\n  m_colorSprite = a1->m_colorSprite;\n  if ( m_colorSprite && !a1->m_unk28c )\n  {\n    m_shouldBlendDetail = a1->m_shouldBlendDetail;\n    if ( a1->m_shouldBlendBase == m_shouldBlendDetail )\n    {\n      GameObject::addColorSpriteToSelf(a1);\n    }\n    else\n    {\n      v5 = a2;\n      m_colorSpriteLocked = a1->m_colorSpriteLocked;\n      a1->m_colorSpriteLocked = 0;\n      m_zLayer = a1->m_zLayer;\n      if ( !m_zLayer )\n        m_zLayer = a1->m_defaultZLayer;\n      if ( m_shouldBlendDetail )\n        m_zLayer += a1->m_colorZLayerRelated;\n      ((void (__fastcall *)(GameObject *))a1->getScaleX)(a1);\n      ((void (__fastcall *)(cocos2d::CCSprite *))m_colorSprite->setScaleX)(m_colorSprite);\n      v8 = a1->m_colorSprite;\n      ((void (__fastcall *)(GameObject *))a1->getScaleY)(a1);\n      ((void (__fastcall *)(cocos2d::CCSprite *))v8->setScaleY)(v8);\n      v9 = a1->m_colorSprite;\n      ((void (__fastcall *)(GameObject *))a1->getRotationX)(a1);\n      ((void (__fastcall *)(cocos2d::CCSprite *))v9->setRotationX)(v9);\n      v10 = a1->m_colorSprite;\n      ((void (__fastcall *)(GameObject *))a1->getRotationY)(a1);\n      ((void (__fastcall *)(cocos2d::CCSprite *))v10->setRotationY)(v10);\n      v11 = a1->m_shouldBlendDetail;\n      ParentMode = GameObject::getParentMode(a1);\n      m_editorEnabled = a1->m_editorEnabled;\n      v14 = GameManager::sharedState();\n      v15 = 504;\n      if ( m_editorEnabled )\n        v15 = 512;\n      v16 = GJBaseGameLayer::parentForZLayer(\n              *(GJBaseGameLayer **)((char *)&v14->__vftable + v15),\n              m_zLayer,\n              v11,\n              ParentMode,\n              a1->m_isUIObject);\n      if ( (cocos2d::CCNode *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_colorSprite->getParent)(a1->m_colorSprite) == v16 )\n      {\n        if ( v5 )\n          ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v16->reorderChild)(v16, a1->m_colorSprite);\n      }\n      else\n      {\n        ((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_colorSprite->removeFromParentAndCleanup)(\n          a1->m_colorSprite,\n          0);\n        ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSprite *))v16->addChild_0)(v16, a1->m_colorSprite);\n        if ( m_colorSpriteLocked )\n        {\n          v17 = a1->m_colorSprite;\n          v18 = ((__int64 (__fastcall *)(GameObject *))a1->getPosition)(a1);\n          ((void (__fastcall *)(cocos2d::CCSprite *, __int64))v17->setPosition)(v17, v18);\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; GameObject::addColorSpriteToParent from 0x100256338 to 0x100256560 (552 bytes)\n; \n; 3 xrefs:\n; > PlayLayer::updateVisibility @ 0x10011c904\n; > GameObject::activateObject @ 0x1002562b8\n; > LevelEditorLayer::updateVisibility @ 0x10035e9c4\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\nSTP             X26, X25, [SP,#-0x10+var_40]!                          ; +0x0, 0x100256338\nSTP             X24, X23, [SP,#0x40+var_30]                            ; +0x4, 0x10025633c\nSTP             X22, X21, [SP,#0x40+var_20]                            ; +0x8, 0x100256340\nSTP             X20, X19, [SP,#0x40+var_10]                            ; +0xc, 0x100256344\nSTP             X29, X30, [SP,#0x40+var_s0]                            ; +0x10, 0x100256348\nADD             X29, SP, #0x40                                         ; +0x14, 0x10025634c\nLDR             X22, [X0,#0x378]                                       ; +0x18, 0x100256350\nCBZ             X22, loc_100256364                                     ; +0x1c, 0x100256354\nMOV             X19, X0                                                ; +0x20, 0x100256358\nLDRB            W8, [X0,#0x28C]                                        ; +0x24, 0x10025635c\nTBZ             W8, #0, loc_10025637C                                  ; +0x28, 0x100256360\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x2c, 0x100256364\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x30, 0x100256368\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0x34, 0x10025636c\nLDP             X24, X23, [SP,#0x40+var_30]                            ; +0x38, 0x100256370\nLDP             X26, X25, [SP+0x40+var_40],#0x50                       ; +0x3c, 0x100256374\nRET                                                                    ; +0x40, 0x100256378\nLDRB            W9, [X19,#0x374]                                       ; +0x44, 0x10025637c\nLDRB            W8, [X19,#0x375]                                       ; +0x48, 0x100256380\nCMP             W9, W8                                                 ; +0x4c, 0x100256384\nB.NE            loc_1002563A8                                          ; +0x50, 0x100256388\nMOV             X0, X19                                                ; +0x54, 0x10025638c\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x58, 0x100256390\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x5c, 0x100256394\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0x60, 0x100256398\nLDP             X24, X23, [SP,#0x40+var_30]                            ; +0x64, 0x10025639c\nLDP             X26, X25, [SP+0x40+var_40],#0x50                       ; +0x68, 0x1002563a0\nB               GameObject__addColorSpriteToSelf                       ; +0x6c, 0x1002563a4\nMOV             X20, X1                                                ; +0x70, 0x1002563a8\nLDRB            W24, [X19,#0x362]                                      ; +0x74, 0x1002563ac\nSTRB            WZR, [X19,#0x362]                                      ; +0x78, 0x1002563b0\nLDR             W21, [X19,#0x464]                                      ; +0x7c, 0x1002563b4\nCBNZ            W21, loc_1002563C0                                     ; +0x80, 0x1002563b8\nLDR             W21, [X19,#0x45C]                                      ; +0x84, 0x1002563bc\nCBZ             W8, loc_1002563CC                                      ; +0x88, 0x1002563c0\nLDRB            W8, [X19,#0x41D]                                       ; +0x8c, 0x1002563c4\nADD             W21, W21, W8                                           ; +0x90, 0x1002563c8\nLDR             X8, [X19]                                              ; +0x94, 0x1002563cc\nLDR             X8, [X8,#0x88]                                         ; +0x98, 0x1002563d0\nMOV             X0, X19                                                ; +0x9c, 0x1002563d4\nBLR             X8                                                     ; +0xa0, 0x1002563d8\nLDR             X8, [X22]                                              ; +0xa4, 0x1002563dc\nLDR             X8, [X8,#0x80]                                         ; +0xa8, 0x1002563e0\nMOV             X0, X22                                                ; +0xac, 0x1002563e4\nBLR             X8                                                     ; +0xb0, 0x1002563e8\nLDR             X22, [X19,#0x378]                                      ; +0xb4, 0x1002563ec\nLDR             X8, [X19]                                              ; +0xb8, 0x1002563f0\nLDR             X8, [X8,#0x98]                                         ; +0xbc, 0x1002563f4\nMOV             X0, X19                                                ; +0xc0, 0x1002563f8\nBLR             X8                                                     ; +0xc4, 0x1002563fc\nLDR             X8, [X22]                                              ; +0xc8, 0x100256400\nLDR             X8, [X8,#0x90]                                         ; +0xcc, 0x100256404\nMOV             X0, X22                                                ; +0xd0, 0x100256408\nBLR             X8                                                     ; +0xd4, 0x10025640c\nLDR             X22, [X19,#0x378]                                      ; +0xd8, 0x100256410\nLDR             X8, [X19]                                              ; +0xdc, 0x100256414\nLDR             X8, [X8,#0x170]                                        ; +0xe0, 0x100256418\nMOV             X0, X19                                                ; +0xe4, 0x10025641c\nBLR             X8                                                     ; +0xe8, 0x100256420\nLDR             X8, [X22]                                              ; +0xec, 0x100256424\nLDR             X8, [X8,#0x168]                                        ; +0xf0, 0x100256428\nMOV             X0, X22                                                ; +0xf4, 0x10025642c\nBLR             X8                                                     ; +0xf8, 0x100256430\nLDR             X22, [X19,#0x378]                                      ; +0xfc, 0x100256434\nLDR             X8, [X19]                                              ; +0x100, 0x100256438\nLDR             X8, [X8,#0x180]                                        ; +0x104, 0x10025643c\nMOV             X0, X19                                                ; +0x108, 0x100256440\nBLR             X8                                                     ; +0x10c, 0x100256444\nLDR             X8, [X22]                                              ; +0x110, 0x100256448\nLDR             X8, [X8,#0x178]                                        ; +0x114, 0x10025644c\nMOV             X0, X22                                                ; +0x118, 0x100256450\nBLR             X8                                                     ; +0x11c, 0x100256454\nLDRB            W22, [X19,#0x375]                                      ; +0x120, 0x100256458\nMOV             X0, X19                                                ; +0x124, 0x10025645c\nBL              GameObject__getParentMode                              ; +0x128, 0x100256460\nMOV             X23, X0                                                ; +0x12c, 0x100256464\nLDRB            W25, [X19,#0x289]                                      ; +0x130, 0x100256468\nBL              GameManager__sharedState                               ; +0x134, 0x10025646c\nLDRB            W4, [X19,#0x541]                                       ; +0x138, 0x100256470\nCMP             W25, #0                                                ; +0x13c, 0x100256474\nMOV             W8, #0x1F8                                             ; +0x140, 0x100256478\nMOV             W9, #0x200                                             ; +0x144, 0x10025647c\nCSEL            X8, X9, X8, NE                                         ; +0x148, 0x100256480\nLDR             X0, [X0,X8]                                            ; +0x14c, 0x100256484\nMOV             X1, X21                                                ; +0x150, 0x100256488\nMOV             X2, X22                                                ; +0x154, 0x10025648c\nMOV             X3, X23                                                ; +0x158, 0x100256490\nBL              GJBaseGameLayer__parentForZLayer                       ; +0x15c, 0x100256494\nMOV             X21, X0                                                ; +0x160, 0x100256498\nLDR             X0, [X19,#0x378]                                       ; +0x164, 0x10025649c\nLDR             X8, [X0]                                               ; +0x168, 0x1002564a0\nLDR             X8, [X8,#0x1F0]                                        ; +0x16c, 0x1002564a4\nBLR             X8                                                     ; +0x170, 0x1002564a8\nCMP             X0, X21                                                ; +0x174, 0x1002564ac\nB.EQ            loc_100256528                                          ; +0x178, 0x1002564b0\nLDR             X0, [X19,#0x378]                                       ; +0x17c, 0x1002564b4\nLDR             X8, [X0]                                               ; +0x180, 0x1002564b8\nLDR             X8, [X8,#0x200]                                        ; +0x184, 0x1002564bc\nMOV             W1, #0                                                 ; +0x188, 0x1002564c0\nBLR             X8                                                     ; +0x18c, 0x1002564c4\nLDR             X1, [X19,#0x378]                                       ; +0x190, 0x1002564c8\nLDR             W2, [X19,#0x468]                                       ; +0x194, 0x1002564cc\nCBNZ            W2, loc_1002564D8                                      ; +0x198, 0x1002564d0\nLDR             W2, [X19,#0x418]                                       ; +0x19c, 0x1002564d4\nLDR             X8, [X21]                                              ; +0x1a0, 0x1002564d8\nLDR             X8, [X8,#0x1C0]                                        ; +0x1a4, 0x1002564dc\nMOV             X0, X21                                                ; +0x1a8, 0x1002564e0\nBLR             X8                                                     ; +0x1ac, 0x1002564e4\nCBZ             W24, loc_100256364                                     ; +0x1b0, 0x1002564e8\nLDR             X20, [X19,#0x378]                                      ; +0x1b4, 0x1002564ec\nLDR             X8, [X19]                                              ; +0x1b8, 0x1002564f0\nLDR             X8, [X8,#0xC0]                                         ; +0x1bc, 0x1002564f4\nMOV             X0, X19                                                ; +0x1c0, 0x1002564f8\nBLR             X8                                                     ; +0x1c4, 0x1002564fc\nMOV             X1, X0                                                 ; +0x1c8, 0x100256500\nLDR             X8, [X20]                                              ; +0x1cc, 0x100256504\nLDR             X2, [X8,#0xB8]                                         ; +0x1d0, 0x100256508\nMOV             X0, X20                                                ; +0x1d4, 0x10025650c\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x1d8, 0x100256510\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x1dc, 0x100256514\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0x1e0, 0x100256518\nLDP             X24, X23, [SP,#0x40+var_30]                            ; +0x1e4, 0x10025651c\nLDP             X26, X25, [SP+0x40+var_40],#0x50                       ; +0x1e8, 0x100256520\nBR              X2                                                     ; +0x1ec, 0x100256524\nCBZ             W20, loc_100256364                                     ; +0x1f0, 0x100256528\nLDR             X1, [X19,#0x378]                                       ; +0x1f4, 0x10025652c\nLDR             W2, [X19,#0x468]                                       ; +0x1f8, 0x100256530\nCBNZ            W2, loc_10025653C                                      ; +0x1fc, 0x100256534\nLDR             W2, [X19,#0x418]                                       ; +0x200, 0x100256538\nLDR             X8, [X21]                                              ; +0x204, 0x10025653c\nLDR             X3, [X8,#0x240]                                        ; +0x208, 0x100256540\nMOV             X0, X21                                                ; +0x20c, 0x100256544\nLDP             X29, X30, [SP,#0x40+var_s0]                            ; +0x210, 0x100256548\nLDP             X20, X19, [SP,#0x40+var_10]                            ; +0x214, 0x10025654c\nLDP             X22, X21, [SP,#0x40+var_20]                            ; +0x218, 0x100256550\nLDP             X24, X23, [SP,#0x40+var_30]                            ; +0x21c, 0x100256554\nLDP             X26, X25, [SP+0x40+var_40],#0x50                       ; +0x220, 0x100256558\nBR              X3                                                     ; +0x224, 0x10025655c", "xrefs": ["PlayLayer::updateVisibility @ 0x10011c904", "GameObject::activateObject @ 0x1002562b8", "LevelEditorLayer::updateVisibility @ 0x10035e9c4"], "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"}