//
// EditorUI::createSmartObjectsFromType from 0x1003f25a8 to 0x1003f2918 (880 bytes)
//
// 1 xrefs:
// > SetupSmartBlockLayer::onCreate @ 0x10006fdcc
//
// 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 EditorUI::createSmartObjectsFromType(EditorUI *a1, int a2, cocos2d::CCArray *a3, bool a4, bool a5)
{
_BOOL4 v6; // w28
cocos2d::CCArray *v10; // x21
int v11; // w23
unsigned int v12; // w22
int v13; // w8
__int16 v14; // w23
ObjectToolbox *v15; // x0
float v16; // s0
cocos2d::CCArray *v17; // x25
unsigned int v18; // w26
__int64 v19; // x28
int i; // w24
cocos2d::CCNode *v21; // x22
__n128 v22; // q0
__n128 v23; // q1
double v24; // d0
float32x2_t *v25; // x0
double v26; // d0
cocos2d::CCArray *v27; // x26
cocos2d::CCArray *v28; // x27
cocos2d::CCArray *v29; // x22
unsigned int v30; // w25
cocos2d::CCArray *RockEdges; // x0
cocos2d::CCArray *RockBases; // x0
cocos2d::CCArray *Outlines; // x0
cocos2d::CCArray *Extras; // x0
EditorUI *v35; // x0
cocos2d::CCArray *v36; // x1
unsigned int v37; // w22
GameObject *v38; // x0
_BOOL4 v39; // [xsp+4h] [xbp-6Ch]
bool v40; // [xsp+8h] [xbp-68h]
int v41; // [xsp+Ch] [xbp-64h]
float32x2_t v42; // [xsp+10h] [xbp-60h] BYREF
float32x2_t v43; // [xsp+18h] [xbp-58h] BYREF
if ( a3 )
{
v6 = a4;
if ( (unsigned int)sub_10024A36C((__int64)a3) )
{
EditorUI::deselectAll(a1);
v10 = (cocos2d::CCArray *)sub_10024A15C();
if ( (unsigned int)sub_10024A36C((__int64)a3) )
{
v11 = 0;
v12 = 0;
do
{
v13 = *(__int16 *)(sub_10024A388((__int64)a3, v12) + 1202);
if ( v11 <= v13 )
v11 = v13;
++v12;
}
while ( v12 < (unsigned int)sub_10024A36C((__int64)a3) );
v14 = v11 + 1;
}
else
{
v14 = 1;
}
v15 = ObjectToolbox::sharedState();
v41 = a2;
v16 = ObjectToolbox::gridNodeSizeForKey(v15, a2);
v17 = a3;
if ( v16 == 15.0 )
{
v17 = (cocos2d::CCArray *)sub_10024A15C();
if ( (unsigned int)sub_10024A36C((__int64)a3) )
{
v39 = v6;
v40 = a5;
v18 = 0;
do
{
v19 = sub_10024A388((__int64)a3, v18);
for ( i = 0; i != 4; ++i )
{
v21 = cocos2d::CCNode::create();
sub_1000229B8((__int64 *)&v43, (__int64 *)&dword_10086E8B0);
if ( i > 1 )
{
if ( i == 2 )
v22.n128_u32[0] = -7.5;
else
v22.n128_u32[0] = 7.5;
v23.n128_u32[0] = -7.5;
}
else
{
if ( i )
v22.n128_u32[0] = 7.5;
else
v22.n128_u32[0] = -7.5;
v23.n128_u32[0] = 7.5;
}
sub_100022980(v22, v23, &v42);
v24 = sub_1000229D0(&v43, (double *)&v42);
v25 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)v19 + 192LL))(v19, v24);
*(float32x2_t *)&v26 = sub_1000229DC(&v43, v25, &v42);
((void (__fastcall *)(cocos2d::CCNode *, float32x2_t *, double))v21->setPosition)(v21, &v42, v26);
sub_10024A2D0((__int64)v17);
}
++v18;
}
while ( v18 < (unsigned int)sub_10024A36C((__int64)a3) );
v6 = v39;
a5 = v40;
}
}
v27 = (cocos2d::CCArray *)sub_10024A15C();
sub_10024A360((__int64)v27, (__int64)v17);
v28 = (cocos2d::CCArray *)sub_10024A15C();
v29 = (cocos2d::CCArray *)sub_10024A15C();
EditorUI::processSmartObjectsFromType(a1, v41, v17, v27, v28, v29);
if ( (unsigned int)sub_10024A36C((__int64)v29) )
{
v30 = 0;
do
*(_WORD *)(sub_10024A388((__int64)v29, v30++) + 1204) = v14;
while ( v30 < (unsigned int)sub_10024A36C((__int64)v29) );
}
sub_10024A360((__int64)v10, (__int64)v29);
if ( (unsigned int)sub_10024A36C((__int64)v10) )
{
RockEdges = EditorUI::createRockEdges(a1, v10);
if ( RockEdges )
sub_10024A360((__int64)v10, (__int64)RockEdges);
RockBases = EditorUI::createRockBases(a1, v10);
if ( RockBases )
sub_10024A360((__int64)v10, (__int64)RockBases);
Outlines = EditorUI::createOutlines(a1, v10);
if ( Outlines )
sub_10024A360((__int64)v10, (__int64)Outlines);
if ( (unsigned int)(v41 - 2703) <= 1 && v6 )
{
Extras = EditorUI::createExtras(a1, v10);
if ( Extras )
sub_10024A360((__int64)v10, (__int64)Extras);
}
EditorUI::deselectAll(a1);
if ( a5 )
{
v35 = a1;
v36 = a3;
}
else
{
if ( (unsigned int)sub_10024A36C((__int64)a3) )
{
v37 = 0;
do
{
v38 = (GameObject *)sub_10024A388((__int64)a3, v37);
EditorUI::deleteObject(a1, v38, 1);
++v37;
}
while ( v37 < (unsigned int)sub_10024A36C((__int64)a3) );
}
v35 = a1;
v36 = v10;
}
EditorUI::selectObjects(v35, v36, 1);
EditorUI::updateButtons(a1);
EditorUI::updateObjectInfoLabel(a1);
((void (__fastcall *)(EditorUI *))a1->updateScaleControl)(a1);
}
}
}
}