//
// EditorUI::createSmartObjectsFromType from 0x100014e00 to 0x1000152ce (1230 bytes)
//
// 1 xrefs:
// > SetupSmartBlockLayer::onCreate @ 0x1004e167f
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:18:54 +0000
//
void __fastcall EditorUI::createSmartObjectsFromType(__int64 a1, unsigned int a2, __int64 a3, int a4, int a5, float a6)
{
__int64 v9; // r13
int v10; // r15d
unsigned int v11; // ebx
int v12; // r14d
__int16 v13; // r15
__int64 v14; // rdi
__int64 v15; // rbx
unsigned int v16; // ecx
__int64 v17; // rdi
__int64 v18; // r13
__int64 v19; // r14
__int64 v20; // rax
__int64 v21; // rdi
__int64 v22; // r14
__int64 v23; // rax
__int64 v24; // rbx
__int64 v25; // rdi
__int64 v26; // r14
__int64 v27; // rax
__int64 v28; // r14
__int64 v29; // rax
unsigned int v30; // eax
__int64 v31; // rdi
__int64 v32; // r12
__int64 v33; // rax
__int64 v34; // rdx
__int64 v35; // rbx
unsigned int v36; // r14d
int v37; // eax
__int64 v38; // r15
char v39; // bl
unsigned __int8 v40; // r14
__int64 RockEdges; // rax
__int64 RockBases; // rax
__int64 Outlines; // rax
__int64 Extras; // rax
__int64 v45; // rdi
__int64 v46; // rsi
unsigned int v47; // ebx
__int64 v48; // rax
__int64 v49; // r14
__int64 v50; // [rsp+8h] [rbp-68h]
__int64 v51; // [rsp+10h] [rbp-60h]
char v52[8]; // [rsp+18h] [rbp-58h] BYREF
int v53; // [rsp+20h] [rbp-50h]
int v54; // [rsp+24h] [rbp-4Ch]
__int64 v55; // [rsp+28h] [rbp-48h]
char v56[8]; // [rsp+30h] [rbp-40h] BYREF
__int64 v57; // [rsp+38h] [rbp-38h]
unsigned int v58; // [rsp+40h] [rbp-30h]
unsigned int v59; // [rsp+44h] [rbp-2Ch]
v59 = a2;
if ( a3 )
{
v9 = a1;
if ( (unsigned int)sub_1007FEF90(a3) )
{
v54 = a4;
v53 = a5;
EditorUI::deselectAll(a1);
v50 = sub_1007FE900(a1);
if ( (unsigned int)sub_1007FEF90(a3) )
{
v10 = 0;
v11 = 0;
do
{
v12 = v10;
v10 = *(__int16 *)(sub_1007FEFE0(a3, v11) + 1202);
if ( v12 > v10 )
v10 = v12;
++v11;
}
while ( v11 < (unsigned int)sub_1007FEF90(a3) );
v13 = v10 + 1;
}
else
{
v13 = 1;
}
v14 = ObjectToolbox::sharedState();
ObjectToolbox::gridNodeSizeForKey(v14, v59);
v15 = a3;
v55 = a3;
if ( a6 == 15.0 )
{
v15 = sub_1007FE900(v14);
v14 = a3;
if ( (unsigned int)sub_1007FEF90(a3) )
{
v51 = v9;
v57 = v15;
v16 = 0;
do
{
v58 = v16;
v17 = v55;
v18 = sub_1007FEFE0(v55, v16);
v19 = cocos2d::CCNode::create(v17);
sub_1002782D0(v52, &qword_100BE0DD8);
sub_100278250(v56, -7.5, 7.5);
sub_100278300(v52, v56);
v20 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v18 + 192LL))(v18);
sub_100278350(v56, v52, v20);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v19 + 184LL))(v19, v56);
v21 = v57;
sub_1007FEBF0(v57, v19);
v22 = cocos2d::CCNode::create(v21);
sub_1002782D0(v52, &qword_100BE0DD8);
sub_100278250(v56, 7.5, 7.5);
sub_100278300(v52, v56);
v23 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v18 + 192LL))(v18);
sub_100278350(v56, v52, v23);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v22 + 184LL))(v22, v56);
v24 = v57;
v25 = v57;
sub_1007FEBF0(v57, v22);
v26 = cocos2d::CCNode::create(v25);
sub_1002782D0(v52, &qword_100BE0DD8);
sub_100278250(v56, -7.5, -7.5);
sub_100278300(v52, v56);
v27 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v18 + 192LL))(v18);
sub_100278350(v56, v52, v27);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v26 + 184LL))(v26);
sub_1007FEBF0(v24, v26);
v28 = cocos2d::CCNode::create(v24);
sub_1002782D0(v52, &qword_100BE0DD8);
sub_100278250(v56, 7.5, -7.5);
sub_100278300(v52, v56);
v29 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v18 + 192LL))(v18);
sub_100278350(v56, v52, v29);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v28 + 184LL))(v28, v56);
sub_1007FEBF0(v57, v28);
++v58;
v14 = v55;
v30 = sub_1007FEF90(v55);
v16 = v58;
}
while ( v58 < v30 );
v9 = v51;
v15 = v57;
}
}
v31 = sub_1007FE900(v14);
sub_1007FEF70(v31, v15);
v32 = sub_1007FE900(v31);
v33 = sub_1007FE900(v31);
v34 = v15;
v35 = v33;
EditorUI::processSmartObjectsFromType(v9, v59, v34, v31, v32, v33);
if ( (unsigned int)sub_1007FEF90(v35) )
{
v36 = 0;
do
*(_WORD *)(sub_1007FEFE0(v35, v36++) + 1204) = v13;
while ( v36 < (unsigned int)sub_1007FEF90(v35) );
}
sub_1007FEF70(v50, v35);
v37 = sub_1007FEF90(v50);
v38 = v55;
v39 = v53;
v40 = v54;
if ( v37 )
{
RockEdges = EditorUI::createRockEdges(v9, v50);
if ( RockEdges )
sub_1007FEF70(v50, RockEdges);
RockBases = EditorUI::createRockBases(v9, v50);
if ( RockBases )
sub_1007FEF70(v50, RockBases);
Outlines = EditorUI::createOutlines(v9, v50);
if ( Outlines )
sub_1007FEF70(v50, Outlines);
if ( !((v59 - 2703 >= 2) | v40 ^ 1) )
{
Extras = EditorUI::createExtras(v9, v50);
if ( Extras )
sub_1007FEF70(v50, Extras);
}
EditorUI::deselectAll(v9);
if ( v39 )
{
v45 = v9;
v46 = v38;
}
else
{
if ( (unsigned int)sub_1007FEF90(v38) )
{
v47 = 0;
do
{
v48 = sub_1007FEFE0(v38, v47);
if ( v48 )
{
v49 = v48;
*(_BYTE *)(v48 + 1132) = *(_BYTE *)(v48 + 1133);
EditorUI::deselectObject(v9, v48);
LevelEditorLayer::removeObject(*(_QWORD *)(v9 + 1440), v49, 1);
EditorUI::deactivateRotationControl(v9);
EditorUI::deactivateScaleControl(v9);
sub_100611790(v9);
}
++v47;
}
while ( v47 < (unsigned int)sub_1007FEF90(v38) );
}
v45 = v9;
v46 = v50;
}
EditorUI::selectObjects(v45, v46, 1);
EditorUI::updateSelectionUI(v9);
}
}
}
}