//
// EditorUI::createSmartObjectsFromType from 0x482bd8 to 0x482e1a (578 bytes)
//
// 1 xrefs:
// > SetupSmartBlockLayer::onCreate @ 0x6726ca
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:49:23 +0000
//
EditorUI *__fastcall EditorUI::createSmartObjectsFromType(
EditorUI *this,
EditorUI *a2,
cocos2d::CCArray *a3,
int a4,
bool a5)
{
EditorUI *v5; // r5
unsigned int v7; // r7
cocos2d::CCArray *v8; // r0
cocos2d::CCArray *v9; // r4
ObjectToolbox *v10; // r0
int v11; // r0
int v12; // r2
ObjectToolbox *v13; // r0
float v14; // r0
cocos2d::CCArray *v15; // r10
cocos2d::CCNode *v16; // r0
int v17; // r8
cocos2d::CCObject *v18; // r11
float v19; // r1
float v20; // r2
int v21; // r0
cocos2d::CCArray *v22; // r8
cocos2d::CCArray *v23; // r0
cocos2d::CCArray *v24; // r9
cocos2d::CCArray *v25; // r0
unsigned int v26; // r9
cocos2d::CCArray *v27; // r7
int v28; // r0
cocos2d::CCArray *RockEdges; // r1
cocos2d::CCArray *RockBases; // r1
cocos2d::CCArray *Outlines; // r1
cocos2d::CCArray *Extras; // r1
unsigned int i; // r7
GameObject *v34; // r0
EditorUI *v35; // r0
cocos2d::CCArray *v36; // r1
cocos2d::CCArray *v37; // [sp+0h] [bp-4Ch]
unsigned int v38; // [sp+Ch] [bp-40h]
int v39; // [sp+10h] [bp-3Ch]
cocos2d::CCNode *v41; // [sp+18h] [bp-34h]
void (__fastcall *v43)(cocos2d::CCObject *, _BYTE *); // [sp+2Ch] [bp-20h]
_BYTE v44[8]; // [sp+34h] [bp-18h] BYREF
_BYTE v45[8]; // [sp+3Ch] [bp-10h] BYREF
v5 = this;
if ( a3 )
{
this = (EditorUI *)cocos2d::CCArray::count(a3);
if ( this )
{
v7 = 0;
v8 = (cocos2d::CCArray *)EditorUI::deselectAll(v5);
v39 = 0;
v9 = (cocos2d::CCArray *)cocos2d::CCArray::create(v8);
while ( 1 )
{
v10 = (ObjectToolbox *)cocos2d::CCArray::count(a3);
if ( v7 >= (unsigned int)v10 )
break;
v11 = cocos2d::CCArray::objectAtIndex(a3, v7);
v12 = v39;
++v7;
if ( v39 < *(__int16 *)(v11 + 1038) )
v12 = *(__int16 *)(v11 + 1038);
v39 = v12;
}
v13 = (ObjectToolbox *)ObjectToolbox::sharedState(v10);
v14 = COERCE_FLOAT(ObjectToolbox::gridNodeSizeForKey(v13, (int)a2));
if ( v14 == 15.0 )
{
v38 = 0;
v15 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)LODWORD(v14));
while ( 1 )
{
v14 = COERCE_FLOAT(cocos2d::CCArray::count(a3));
if ( v38 >= LODWORD(v14) )
goto LABEL_23;
v16 = (cocos2d::CCNode *)cocos2d::CCArray::objectAtIndex(a3, v38);
v17 = 0;
v41 = v16;
do
{
v18 = (cocos2d::CCObject *)cocos2d::CCNode::create(v16);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v44, (const cocos2d::CCPoint *)&flt_D2B938);
if ( v17 == 2 )
{
v19 = -7.5;
LABEL_18:
v20 = v19;
goto LABEL_20;
}
if ( v17 != 3 )
{
if ( v17 != 1 )
{
v19 = -7.5;
v20 = 7.5;
goto LABEL_20;
}
v19 = 7.5;
goto LABEL_18;
}
v19 = 7.5;
v20 = -7.5;
LABEL_20:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, v19, v20);
++v17;
cocos2d::CCPoint::operator=(v44, v45);
v43 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v18 + 92);
v21 = (*(int (__fastcall **)(cocos2d::CCNode *))(*(_DWORD *)v41 + 96))(v41);
cocos2d::CCPoint::operator+(v45, v44, v21);
v43(v18, v45);
v16 = (cocos2d::CCNode *)cocos2d::CCArray::addObject(v15, v18);
}
while ( v17 != 4 );
++v38;
}
}
v15 = a3;
LABEL_23:
v22 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)LODWORD(v14));
v23 = (cocos2d::CCArray *)cocos2d::CCArray::addObjectsFromArray(v22, v15);
v24 = (cocos2d::CCArray *)cocos2d::CCArray::create(v23);
v25 = (cocos2d::CCArray *)cocos2d::CCArray::create(v24);
v37 = v24;
v26 = 0;
v27 = v25;
EditorUI::processSmartObjectsFromType(v5, a2, v15, v22, v37, v25);
while ( v26 < cocos2d::CCArray::count(v27) )
{
v28 = cocos2d::CCArray::objectAtIndex(v27, v26++);
*(_WORD *)(v28 + 1040) = v39 + 1;
}
cocos2d::CCArray::addObjectsFromArray(v9, v27);
this = (EditorUI *)cocos2d::CCArray::count(v9);
if ( this )
{
RockEdges = (cocos2d::CCArray *)EditorUI::createRockEdges(v5, v9);
if ( RockEdges )
cocos2d::CCArray::addObjectsFromArray(v9, RockEdges);
RockBases = (cocos2d::CCArray *)EditorUI::createRockBases(v5, v9);
if ( RockBases )
cocos2d::CCArray::addObjectsFromArray(v9, RockBases);
Outlines = (cocos2d::CCArray *)EditorUI::createOutlines(v5, v9);
if ( Outlines )
cocos2d::CCArray::addObjectsFromArray(v9, Outlines);
if ( a4 )
{
if ( (unsigned int)a2 - 2703 <= 1 )
{
Extras = (cocos2d::CCArray *)EditorUI::createExtras(v5, v9);
if ( Extras )
cocos2d::CCArray::addObjectsFromArray(v9, Extras);
}
}
EditorUI::deselectAll(v5);
if ( a5 )
{
v35 = v5;
v36 = a3;
}
else
{
for ( i = 0; i < cocos2d::CCArray::count(a3); ++i )
{
v34 = (GameObject *)cocos2d::CCArray::objectAtIndex(a3, i);
EditorUI::deleteObject(v5, v34, 1);
}
v35 = v5;
v36 = v9;
}
EditorUI::selectObjects(v35, v36, 1);
return (EditorUI *)EditorUI::updateSelectionUI(v5);
}
}
}
return this;
}