//
// EditorUI::processSmartObjectsFromType from 0x1003f2918 to 0x1003f2b84 (620 bytes)
//
// 2 xrefs:
// > EditorUI::createSmartObjectsFromType @ 0x1003f279c
// > EditorUI::processSmartObjectsFromType @ 0x1003f2b60
//
// 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::processSmartObjectsFromType(
EditorUI *a1,
int a2,
cocos2d::CCArray *a3,
cocos2d::CCArray *a4,
cocos2d::CCArray *a5,
cocos2d::CCArray *a6)
{
_BOOL4 v12; // w9
int v13; // w19
int *v14; // x25
__int64 v15; // x26
EditorUI *v16; // x0
cocos2d::CCNode *Neighbor; // x0
cocos2d::CCNode *v18; // x27
int v19; // w0
int SmartObjectKey; // w28
__int64 *v21; // x0
EditorUI *v22; // x0
int v23; // w1
cocos2d::CCArray *v24; // x2
cocos2d::CCArray *v25; // x3
cocos2d::CCArray *v26; // x4
cocos2d::CCArray *v27; // x5
__int64 v28; // x0
__int64 *v29; // x0
int RandomStartKey; // w25
cocos2d::CCArray *v31; // [xsp+0h] [xbp-70h]
cocos2d::CCArray v32; // [xsp+8h] [xbp-68h] BYREF
cocos2d::CCPoint v33; // 0:s0.4,4:s1.4
cocos2d::CCPoint v34; // 0:s0.4,4:s1.4
cocos2d::CCPoint v35; // 0:s0.4,4:s1.4
cocos2d::CCPoint v36; // 0:s0.4,4:s1.4
cocos2d::CCPoint v37; // 0:s0.4,4:s1.4
v12 = a2 == 2838;
if ( a2 == 2703 )
v12 = 1;
v13 = a2 == 869 || v12;
if ( (unsigned int)sub_10024A36C((__int64)a5) )
{
v31 = a6;
v14 = (int *)sub_10024A388((__int64)a5, 0);
(*(void (__fastcall **)(int *__return_ptr))(*(_QWORD *)v14 + 1344LL))(&v32.m_nTag);
v15 = 1;
do
{
v33.x = sub_1000229B8((__int64 *)&v32.m_uID, (__int64 *)&v32.m_nTag);
Neighbor = EditorUI::getNeighbor(v16, a2, v33, (GJSmartDirection)&v32.m_uID, (cocos2d::CCArray *)v15);
if ( Neighbor )
{
v18 = Neighbor;
v19 = EditorUI::convertToBaseKey(a1, v14[257]);
SmartObjectKey = EditorUI::getSmartObjectKey(v19, (GJSmartDirection)v15);
v21 = (__int64 *)((__int64 (__fastcall *)(cocos2d::CCNode *))v18->getPosition)(v18);
sub_1000229B8((__int64 *)&v32.m_uID, v21);
if ( v13 )
{
v34.x = sub_1000229B8((__int64 *)&v32, (__int64 *)&v32.m_uID);
SmartObjectKey = EditorUI::convertKeyBasedOnNeighbors(a1, SmartObjectKey, a2, v34, &v32);
}
v35.x = sub_1000229B8((__int64 *)&v32, (__int64 *)&v32.m_uID);
EditorUI::createObject(a1, SmartObjectKey, v35);
sub_10024A2D0((__int64)a5);
sub_10024A444((__int64)a4);
}
v15 = (unsigned int)(v15 + 1);
}
while ( (_DWORD)v15 != 9 );
sub_10024A2D0((__int64)v31);
sub_10024A444((__int64)a5);
v22 = a1;
v23 = a2;
v24 = a3;
v25 = a4;
v26 = a5;
v27 = v31;
}
else
{
if ( !(unsigned int)sub_10024A36C((__int64)a4) )
return;
v28 = sub_10024A388((__int64)a4, 0);
v29 = (__int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v28 + 192LL))(v28);
sub_1000229B8((__int64 *)&v32.m_nTag, v29);
RandomStartKey = EditorUI::getRandomStartKey(a2);
if ( v13 )
{
v36.x = sub_1000229B8((__int64 *)&v32.m_uID, (__int64 *)&v32.m_nTag);
RandomStartKey = EditorUI::convertKeyBasedOnNeighbors(a1, RandomStartKey, a2, v36, (cocos2d::CCArray *)&v32.m_uID);
}
v37.x = sub_1000229B8((__int64 *)&v32.m_uID, (__int64 *)&v32.m_nTag);
EditorUI::createObject(a1, RandomStartKey, v37);
sub_10024A2D0((__int64)a5);
sub_10024A44C((__int64)a4, 0, 1);
v22 = a1;
v23 = a2;
v24 = a3;
v25 = a4;
v26 = a5;
v27 = a6;
}
EditorUI::processSmartObjectsFromType(v22, v23, v24, v25, v26, v27);
}