// // SetupSmartBlockLayer::onPasteTemplate from 0x1004e6ef0 to 0x1004e710d (541 bytes) // // 1 xrefs: // > SetupSmartBlockLayer::init @ 0x1004e60f1 // // 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 __fastcall SetupSmartBlockLayer::onPasteTemplate(SetupSmartBlockLayer *a1, cocos2d::CCObject *a2) { SetupSmartBlockLayer *v2; // rbx EditorUI *m_editorUI; // r14 cocos2d::CCArray *v4; // r14 cocos2d::CCLayer *m_objectLayer; // r12 GameManager *v6; // rax cocos2d::CCPoint v7; // xmm0_8 EditorUI *v8; // rbx cocos2d::CCPoint v9; // xmm0_8 GameLevelManager *v10; // rax GJSmartTemplate *ActiveSmartTemplate; // rax GJSmartTemplate *v12; // r15 GameManager *v13; // rax __int64 v14; // [rsp+10h] [rbp-70h] BYREF __int64 v15; // [rsp+18h] [rbp-68h] BYREF SetupSmartBlockLayer *v16; // [rsp+20h] [rbp-60h] std::string v17; // [rsp+28h] [rbp-58h] BYREF float v18[2]; // [rsp+40h] [rbp-40h] BYREF __int64 v19; // [rsp+48h] [rbp-38h] BYREF float v20; // [rsp+50h] [rbp-30h] float v21; // [rsp+54h] [rbp-2Ch] v2 = a1; if ( GameManager::sharedState()->m_levelEditorLayer ) { m_editorUI = GameManager::sharedState()->m_levelEditorLayer->m_editorUI; v17.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x1760u); v17.__r_.__value_.__r.__words[0] = 5985; v17.__r_.__value_.__l.__size_ = 5983; memcpy(v17.__r_.__value_.__l.__data_, a12895236453195, 0x175Fu); *(_BYTE *)(v17.__r_.__value_.__r.__words[2] + 5983) = 0; a2 = (cocos2d::CCObject *)&v17; v4 = EditorUI::pasteObjects(m_editorUI, &v17, 0, 0); if ( (*(_BYTE *)&v17.__r_.__value_.__s.0 & 1) != 0 ) operator delete(v17.__r_.__value_.__l.__data_); if ( v4 && (unsigned int)sub_100720070(v4) ) { v16 = a1; cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v18); m_objectLayer = GameManager::sharedState()->m_levelEditorLayer->m_objectLayer; v20 = v18[0] * 0.5; v21 = v18[1] * 0.5; v6 = GameManager::sharedState(); sub_10028CBE0((float *)&v19, v20, (float)(0.5 * v6->m_levelEditorLayer->m_editorUI->m_toolbarHeight) + v21); cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v14, (const cocos2d::CCPoint *)m_objectLayer); GameManager::sharedState(); *(double *)&v7 = sub_10028CC60(&v15, (double *)&v14); EditorUI::getGridSnappedPos((EditorUI *)&v19, v7); sub_10028CC90(&v14, (double *)&v19); v8 = GameManager::sharedState()->m_levelEditorLayer->m_editorUI; *(double *)&v9 = sub_10028CC60(&v19, (double *)&v14); a2 = v4; EditorUI::repositionObjectsToCenter(v8, v4, v9, (bool)&v19); v10 = GameLevelManager::sharedState(); ActiveSmartTemplate = GameLevelManager::getActiveSmartTemplate(v10); if ( ActiveSmartTemplate ) { v12 = ActiveSmartTemplate; v13 = GameManager::sharedState(); a2 = v12; EditorUI::createSmartObjectsFromTemplate(v13->m_levelEditorLayer->m_editorUI, v12, v4, 0, 1, 1, 0); } v2 = v16; } } SetupSmartBlockLayer::onClose(v2, a2); }
GD Web Decomp Icon

GD Web Decomp

Raw Source