//
// EditorUI::createRockBases from 0x9cd228 to 0x9cdb04 (2268 bytes)
//
// 3 xrefs:
// > EditorUI::createSmartObjectsFromType @ 0x6c13d4
// > EditorPauseLayer::onCreateExtras @ 0x78ab4c
// > ??> @ 0x7c3c8
//
// 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
//
cocos2d::CCArray *EditorUI::createRockBases(EditorUI *a1, cocos2d::CCArray *a2)
{
cocos2d::CCArray *v2; // x0
cocos2d::CCArray *v3; // x21
unsigned int v4; // w20
float *v5; // x19
_BOOL4 v7; // w25
int v8; // w22
int v9; // w24
int v10; // w22
GameObject *Object; // x22
void (__fastcall *setRotation)(GameObject *__hidden, float); // x25
void (__fastcall *setFlipX)(GameObject *__hidden, bool); // x25
int v14; // w0
void (__fastcall *setFlipY)(GameObject *__hidden, bool); // x25
int v16; // w0
float v17; // s0
float v18; // s1
float v19; // s0
float v20; // s1
GameObject *v21; // x22
void (__fastcall *v22)(GameObject *__hidden, float); // x23
void (__fastcall *v23)(GameObject *__hidden, bool); // x23
int v24; // w0
void (__fastcall *v25)(GameObject *__hidden, bool); // x23
int v26; // w0
float v27; // s0
float v28; // s1
float v29; // s0
float v30; // s1
float v31; // s0
float v32; // s1
float v33; // s0
float v34; // s1
unsigned int v35; // w27
_BOOL4 v36; // w26
_BOOL4 v37; // w24
_BOOL4 v38; // w23
__int64 v39; // x0
const cocos2d::CCRect *v40; // x0
float v41; // s0
float v42; // s1
float v43; // s0
float v44; // s1
float v45; // s0
float v46; // s1
float v47; // s0
float v48; // s1
float v49; // s0
float v50; // s1
float v51; // s0
float v52; // s1
float v53; // s0
float v54; // s1
float v55; // s0
float v56; // s1
float v57; // s0
float v58; // s1
float v59; // s0
float v60; // s1
float v61; // s0
float v62; // s1
float v63; // s0
float v64; // s1
float v65; // s0
float v66; // s1
cocos2d::CCArray *v68; // [xsp+98h] [xbp+98h]
cocos2d::CCArray v70; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::CCPoint v71; // [xsp+F0h] [xbp+F0h] BYREF
cocos2d::CCRect v72; // [xsp+F8h] [xbp+F8h] BYREF
cocos2d::CCPoint v73; // 0:s0.4,4:s1.4
cocos2d::CCPoint v74; // 0:s0.4,4:s1.4
if ( !a2 )
return nullptr;
v2 = (cocos2d::CCArray *)cocos2d::CCArray::count(a2);
if ( !(_DWORD)v2 )
return nullptr;
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(v2);
v4 = 0;
v68 = (cocos2d::CCArray *)cocos2d::CCArray::create(&v70);
cocos2d::CCArray::addObjectsFromArray(v3, a2);
if ( (unsigned int)cocos2d::CCArray::count(v3) )
{
while ( 1 )
{
v5 = (float *)cocos2d::CCArray::objectAtIndex(v3, v4);
(*(void (__fastcall **)(float *))(*(_QWORD *)v5 + 1344LL))(v5);
if ( (unsigned int)(*((_DWORD *)v5 + 253) - 1348) <= 3 )
break;
v7 = 0;
v8 = 0;
LABEL_8:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v70.m_uOrderOfArrival, &stru_1243DD0);
switch ( *((_DWORD *)v5 + 253) )
{
case 0x544:
if ( v8 )
{
v9 = 0;
v10 = 1352;
}
else if ( v7 )
{
v9 = 1391;
v10 = 1387;
cocos2d::CCPoint::CCPoint(&v72.origin, 0.0, -30.0);
cocos2d::CCPoint::operator=(&v70.m_uOrderOfArrival, v65, v66);
}
else
{
v9 = 0;
v10 = 1387;
}
goto LABEL_10;
case 0x545:
if ( v8 )
{
v9 = 0;
v10 = 1353;
}
else
{
if ( v7 )
v9 = 1392;
else
v9 = 0;
v10 = 1388;
}
goto LABEL_10;
case 0x546:
if ( v8 )
{
v9 = 0;
v10 = 1354;
}
else
{
if ( v7 )
v9 = 1394;
else
v9 = 0;
v10 = 1389;
}
goto LABEL_10;
case 0x547:
if ( v8 )
{
v9 = 0;
v10 = 1355;
}
else
{
if ( v7 )
v9 = 1393;
else
v9 = 0;
v10 = 1390;
}
goto LABEL_10;
case 0x597:
v9 = 0;
v10 = 1442;
goto LABEL_10;
case 0x598:
v9 = 0;
v10 = 1443;
goto LABEL_10;
case 0x599:
v9 = 0;
v10 = 1444;
goto LABEL_10;
case 0x59A:
v9 = 0;
v10 = 1445;
goto LABEL_10;
case 0x59B:
v9 = 0;
v10 = 1446;
goto LABEL_10;
case 0x59C:
v9 = 0;
v10 = 1447;
goto LABEL_10;
case 0x59D:
v9 = 0;
v10 = 1448;
goto LABEL_10;
case 0x59E:
v9 = 0;
v10 = 1449;
goto LABEL_10;
case 0x59F:
v9 = 0;
v10 = 1450;
goto LABEL_10;
case 0x5A0:
v9 = 0;
v10 = 1451;
goto LABEL_10;
case 0x5A1:
v9 = 0;
v10 = 1452;
goto LABEL_10;
case 0x5E6:
v9 = 0;
v10 = 1513;
goto LABEL_10;
case 0x5E7:
v9 = 0;
v10 = 1514;
goto LABEL_10;
case 0x5E8:
v9 = 0;
v10 = 1515;
LABEL_10:
(*(void (__fastcall **)(cocos2d::CCRect *__return_ptr, float *))(*(_QWORD *)v5 + 1344LL))(&v72, v5);
Object = EditorUI::createObject(a1, v10, v73);
setRotation = Object->setRotation;
(*(void (__fastcall **)(float *))(*(_QWORD *)v5 + 352LL))(v5);
((void (__fastcall *)(GameObject *))setRotation)(Object);
setFlipX = Object->setFlipX;
v14 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v5 + 1408LL))(v5);
setFlipX(Object, v14);
setFlipY = Object->setFlipY;
v16 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v5 + 1416LL))(v5);
setFlipY(Object, v16);
GameObject::updateCustomScaleX(Object, v5[284]);
GameObject::updateCustomScaleY(Object, v5[285]);
Object->m_editorLayer2 = *((_WORD *)v5 + 593) + 2;
cocos2d::CCArray::addObject(v68, Object);
if ( v9 )
{
(*(void (__fastcall **)(cocos2d::ccArray **__return_ptr, float *))(*(_QWORD *)v5 + 1344LL))(&v70.data, v5);
EditorUI::offsetForKey(a1, v9);
cocos2d::CCPoint::operator+(&v72, &v70.data, &v71);
cocos2d::CCPoint::operator=(&v70.data, v17, v18);
cocos2d::CCPoint::operator+(&v72, &v70.data, &v70.m_uOrderOfArrival);
cocos2d::CCPoint::operator=(&v70.data, v19, v20);
cocos2d::CCPoint::CCPoint(&v72.origin, (const cocos2d::CCPoint *)&v70.data);
v21 = EditorUI::createObject(a1, v9, v74);
v22 = v21->setRotation;
(*(void (__fastcall **)(float *))(*(_QWORD *)v5 + 352LL))(v5);
((void (__fastcall *)(GameObject *))v22)(v21);
v23 = v21->setFlipX;
v24 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v5 + 1408LL))(v5);
v23(v21, v24);
v25 = v21->setFlipY;
v26 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v5 + 1416LL))(v5);
v25(v21, v26);
GameObject::updateCustomScaleX(v21, v5[284]);
GameObject::updateCustomScaleY(v21, v5[285]);
v21->m_editorLayer2 = *((_WORD *)v5 + 593) + 2;
cocos2d::CCArray::addObject(v68, v21);
}
break;
default:
break;
}
if ( ++v4 >= (unsigned int)cocos2d::CCArray::count(v3) )
return v68;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v70.m_uID);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v70.m_nTag);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v70.m_uAutoReleaseCount);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v70.m_uIndexInArray);
switch ( *((_DWORD *)v5 + 253) )
{
case 0x544:
cocos2d::CCPoint::CCPoint(&v72.origin, 30.0, 0.0);
cocos2d::CCPoint::operator=(&v70.m_uID, v49, v50);
cocos2d::CCPoint::CCPoint(&v72.origin, 30.0, -30.0);
cocos2d::CCPoint::operator=(&v70.m_nTag, v51, v52);
cocos2d::CCPoint::CCPoint(&v72.origin, 0.0, -30.0);
cocos2d::CCPoint::operator=(&v70.m_uAutoReleaseCount, v53, v54);
cocos2d::CCPoint::CCPoint(&v72.origin, 0.0, -30.0);
cocos2d::CCPoint::operator=(&v70.m_uIndexInArray, v55, v56);
break;
case 0x545:
cocos2d::CCPoint::CCPoint(&v72.origin, -30.0, 0.0);
cocos2d::CCPoint::operator=(&v70.m_uID, v27, v28);
cocos2d::CCPoint::CCPoint(&v72.origin, -30.0, -30.0);
cocos2d::CCPoint::operator=(&v70.m_nTag, v29, v30);
cocos2d::CCPoint::CCPoint(&v72.origin, 0.0, -30.0);
cocos2d::CCPoint::operator=(&v70.m_uAutoReleaseCount, v31, v32);
cocos2d::CCPoint::CCPoint(&v72.origin, -30.0, 0.0);
cocos2d::CCPoint::operator=(&v70.m_uIndexInArray, v33, v34);
break;
case 0x546:
cocos2d::CCPoint::CCPoint(&v72.origin, 0.0, 30.0);
cocos2d::CCPoint::operator=(&v70.m_uID, v41, v42);
cocos2d::CCPoint::CCPoint(&v72.origin, 30.0, 30.0);
cocos2d::CCPoint::operator=(&v70.m_nTag, v43, v44);
cocos2d::CCPoint::CCPoint(&v72.origin, 30.0, 0.0);
cocos2d::CCPoint::operator=(&v70.m_uAutoReleaseCount, v45, v46);
cocos2d::CCPoint::CCPoint(&v72.origin, 30.0, 0.0);
cocos2d::CCPoint::operator=(&v70.m_uIndexInArray, v47, v48);
break;
case 0x547:
cocos2d::CCPoint::CCPoint(&v72.origin, 0.0, 30.0);
cocos2d::CCPoint::operator=(&v70.m_uID, v57, v58);
cocos2d::CCPoint::CCPoint(&v72.origin, -30.0, 30.0);
cocos2d::CCPoint::operator=(&v70.m_nTag, v59, v60);
cocos2d::CCPoint::CCPoint(&v72.origin, -30.0, 0.0);
cocos2d::CCPoint::operator=(&v70.m_uAutoReleaseCount, v61, v62);
cocos2d::CCPoint::CCPoint(&v72.origin, 0.0, 30.0);
cocos2d::CCPoint::operator=(&v70.m_uIndexInArray, v63, v64);
break;
default:
break;
}
cocos2d::CCPoint::operator+(&v70.m_unknown2, &v70, &v70.m_uID);
v35 = 0;
v7 = 0;
v36 = 0;
v37 = 0;
cocos2d::CCPoint::operator+(&v70.m_uOrderOfArrival, &v70, &v70.m_nTag);
v38 = 0;
v8 = 0;
cocos2d::CCPoint::operator+(&v70.data, &v70, &v70.m_uAutoReleaseCount);
cocos2d::CCPoint::operator+(&v71, &v70, &v70.m_uIndexInArray);
while ( 1 )
{
if ( v35 >= (unsigned int)cocos2d::CCArray::count(v3) )
goto LABEL_8;
if ( v35 == v4 )
{
LABEL_22:
if ( !v37 || !v38 )
goto LABEL_32;
goto LABEL_23;
}
v39 = cocos2d::CCArray::objectAtIndex(v3, v35);
v40 = (const cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v39 + 1312LL))(v39);
cocos2d::CCRect::CCRect(&v72, v40);
if ( v38 )
{
if ( v37 )
goto LABEL_20;
}
else
{
v38 = (unsigned __int8)cocos2d::CCRect::containsPoint(&v72, (const cocos2d::CCPoint *)&v70.m_unknown2) != 0;
if ( v37 )
{
LABEL_20:
if ( v36 )
goto LABEL_21;
goto LABEL_30;
}
}
v37 = (unsigned __int8)cocos2d::CCRect::containsPoint(&v72, (const cocos2d::CCPoint *)&v70.m_uOrderOfArrival) != 0;
if ( v36 )
{
LABEL_21:
if ( v7 )
goto LABEL_22;
goto LABEL_31;
}
LABEL_30:
v36 = (unsigned __int8)cocos2d::CCRect::containsPoint(&v72, (const cocos2d::CCPoint *)&v70.data) != 0;
if ( v7 )
goto LABEL_22;
LABEL_31:
v7 = (unsigned __int8)cocos2d::CCRect::containsPoint(&v72, &v71) != 0;
if ( !v37 || !v38 )
goto LABEL_32;
LABEL_23:
if ( v36 )
{
v8 = 1;
if ( v7 )
goto LABEL_34;
goto LABEL_25;
}
LABEL_32:
if ( v8 && v7 )
{
LABEL_34:
v7 = 1;
v8 = 1;
goto LABEL_8;
}
LABEL_25:
++v35;
}
}
return v68;
}