//
// EditorUI::createRockEdges from 0xb07ae4 to 0xb07f40 (1116 bytes)
//
// 2 xrefs:
// > EditorUI::createSmartObjectsFromType @ 0x7c36c4
// > ??> @ 0x105a00
//
// This function is hookable on this platform (idp: arm, 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 13:01:24 +0000
//
cocos2d::CCArray *__fastcall EditorUI::createRockEdges(EditorUI *this, cocos2d::CCArray *a2)
{
cocos2d::CCArray *v3; // x0
cocos2d::CCArray *v4; // x19
unsigned int v5; // w20
int v6; // w22
GameObject *v7; // x24
unsigned int v8; // w28
__int64 v9; // x0
cocos2d::CCRect *v10; // x0
float *EdgeForObject; // x1
_BOOL4 v12; // w0
float *v13; // x1
cocos2d::CCArray *v14; // x20
GameObject *v15; // x23
unsigned int *v16; // x1
GameObject **v17; // x19
__int64 v18; // x0
char *v19; // x21
GameObject *v20; // x22
float *v22; // x1
float *v23; // x1
float *v24; // x1
int v25; // [xsp+68h] [xbp+68h]
cocos2d::CCArray *v26; // [xsp+70h] [xbp+70h]
int v27; // [xsp+78h] [xbp+78h]
int v28; // [xsp+78h] [xbp+78h]
int v29; // [xsp+84h] [xbp+84h]
int v31; // [xsp+88h] [xbp+88h]
__int64 v32; // [xsp+90h] [xbp+90h] BYREF
char v33[8]; // [xsp+98h] [xbp+98h] BYREF
__int64 v34; // [xsp+A0h] [xbp+A0h] BYREF
if ( !a2 )
return nullptr;
v3 = (cocos2d::CCArray *)cocos2d::CCArray::count(a2);
if ( !(_DWORD)v3 )
return nullptr;
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
v5 = 0;
v26 = (cocos2d::CCArray *)cocos2d::CCArray::create(v4);
cocos2d::CCArray::addObjectsFromArray(v4, a2);
if ( !(unsigned int)cocos2d::CCArray::count(v4) )
goto LABEL_30;
do
{
v27 = 0;
v6 = 0;
v29 = 0;
v31 = 0;
v7 = (GameObject *)cocos2d::CCArray::objectAtIndex(v4, v5);
(*(void (__fastcall **)(__int64 *__return_ptr))(*(_QWORD *)v7 + 1360LL))(&v32);
do
{
while ( 1 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, (const cocos2d::CCPoint *)&unk_155E0B0);
if ( v6 == 2 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, 0.0, -30.0);
cocos2d::CCPoint::operator=(v33, &v34);
}
else if ( v6 == 3 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, -30.0, 0.0);
cocos2d::CCPoint::operator=(v33, &v34);
}
else
{
if ( v6 == 1 )
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, 30.0, 0.0);
else
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, 0.0, 30.0);
cocos2d::CCPoint::operator=(v33, &v34);
}
v8 = 0;
cocos2d::CCPoint::operator+(&v34, &v32);
if ( (unsigned int)cocos2d::CCArray::count(v4) )
{
do
{
if ( v8 != v5 )
{
v9 = cocos2d::CCArray::objectAtIndex(v4, v8);
v10 = (cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 1328LL))(v9);
if ( (unsigned __int8)cocos2d::CCRect::containsPoint(v10, (const cocos2d::CCPoint *)&v34) )
goto LABEL_28;
}
}
while ( ++v8 < (unsigned int)cocos2d::CCArray::count(v4) );
}
EdgeForObject = EditorUI::createEdgeForObject(this, v7, v6);
if ( EdgeForObject )
cocos2d::CCArray::addObject(v26, (cocos2d::CCObject *)EdgeForObject);
switch ( v6 )
{
case 1:
v29 = 1;
if ( !v31 )
goto LABEL_28;
v24 = EditorUI::createEdgeForObject(this, v7, 4);
if ( !v24 )
{
v29 = 1;
goto LABEL_23;
}
cocos2d::CCArray::addObject(v26, (cocos2d::CCObject *)v24);
break;
case 2:
v27 = 1;
break;
case 0:
v31 = 1;
break;
}
if ( v29 )
{
if ( v6 == 2 )
{
v23 = EditorUI::createEdgeForObject(this, v7, 5);
v29 = 1;
if ( v23 )
cocos2d::CCArray::addObject(v26, (cocos2d::CCObject *)v23);
}
}
LABEL_23:
v12 = v6 == 3;
if ( (v27 & v12) != 0 )
{
v28 = v27 & v12;
v22 = EditorUI::createEdgeForObject(this, v7, 6);
if ( v22 )
{
v25 = v28;
v27 = 1;
cocos2d::CCArray::addObject(v26, (cocos2d::CCObject *)v22);
v12 = v25;
}
else
{
v12 = v28;
v27 = 1;
}
}
if ( !v31 || !v12 )
goto LABEL_28;
v13 = EditorUI::createEdgeForObject(this, v7, 7);
if ( !v13 )
break;
v31 = 1;
cocos2d::CCArray::addObject(v26, (cocos2d::CCObject *)v13);
LABEL_28:
if ( ++v6 == 4 )
goto LABEL_29;
}
++v6;
v31 = 1;
}
while ( v6 != 4 );
LABEL_29:
++v5;
}
while ( v5 < (unsigned int)cocos2d::CCArray::count(v4) );
LABEL_30:
v14 = v26;
if ( (unsigned int)cocos2d::CCArray::count(v26) )
{
v15 = (GameObject *)cocos2d::CCArray::objectAtIndex(v4, 0);
if ( v15 )
{
if ( v26 )
{
v16 = *((unsigned int **)v26 + 7);
if ( *v16 )
{
v17 = *((GameObject ***)v16 + 2);
v18 = 8LL * *v16 - 8;
v19 = (char *)v17 + v18;
if ( v17 <= (GameObject **)((char *)v17 + v18) )
{
v20 = *v17;
if ( *v17 )
{
do
{
++v17;
GameObject::duplicateColorMode((__int64)v20, v15);
GameObject::duplicateAttributes(v20, v15);
*((_BYTE *)v20 + 1148) = 1;
if ( v19 < (char *)v17 )
break;
v20 = *v17;
}
while ( *v17 );
return v26;
}
}
}
}
}
}
return v14;
}