//
// EditorUI::createRockBases from 0x537400 to 0x5379d4 (1492 bytes)
//
// 2 xrefs:
// > EditorUI::createSmartObjectsFromType @ 0x3a496c
// > EditorPauseLayer::onCreateExtras @ 0x3ff276
//
// 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 *v3; // r0
unsigned int v5; // r8
cocos2d::CCArray *v6; // r9
float *v7; // r5
int v8; // r4
int v9; // r7
int v10; // r2
bool v11; // r3
int v12; // r2
bool v13; // r3
int v14; // r2
bool v15; // r3
float v16; // r2
float v17; // r1
int v18; // r2
bool v19; // r3
unsigned int v20; // r6
_BOOL4 v21; // r11
int v22; // r3
int v23; // r6
int v24; // r2
bool v25; // r3
bool v26; // zf
cocos2d::CCPoint v27; // r2
GameObject *Object; // r6
void (__fastcall *setRotation)(GameObject *__hidden, float); // r10
int v30; // r0
void (__fastcall *setFlipX)(GameObject *__hidden, bool); // r10
int v32; // r0
void (__fastcall *setFlipY)(GameObject *__hidden, bool); // r10
int v34; // r0
int v35; // r2
bool v36; // r3
int v37; // r2
bool v38; // r3
cocos2d::CCPoint v39; // r2
GameObject *v40; // r4
void (__fastcall *v41)(GameObject *__hidden, float); // r6
int v42; // r0
void (__fastcall *v43)(GameObject *__hidden, bool); // r6
int v44; // r0
void (__fastcall *v45)(GameObject *__hidden, bool); // r6
int v46; // r0
int v47; // r2
bool v48; // r3
int v49; // r2
bool v50; // r3
int v51; // r2
bool v52; // r3
int v53; // r2
bool v54; // r3
int v55; // r2
bool v56; // r3
int v57; // r2
bool v58; // r3
int v59; // r2
bool v60; // r3
int v61; // r2
bool v62; // r3
int v63; // r2
bool v64; // r3
int v65; // r0
const cocos2d::CCRect *v66; // r0
_BOOL4 v67; // [sp+0h] [bp-84h]
_BOOL4 v68; // [sp+4h] [bp-80h]
cocos2d::CCArray *v69; // [sp+8h] [bp-7Ch]
_BYTE v71[8]; // [sp+24h] [bp-60h] BYREF
cocos2d::CCPoint v72; // [sp+2Ch] [bp-58h] BYREF
cocos2d::CCPoint v73; // [sp+34h] [bp-50h] BYREF
cocos2d::CCPoint v74; // [sp+3Ch] [bp-48h] BYREF
cocos2d::CCPoint v75; // [sp+44h] [bp-40h] BYREF
cocos2d::CCPoint v76; // [sp+4Ch] [bp-38h] BYREF
cocos2d::CCPoint v77; // [sp+54h] [bp-30h] BYREF
cocos2d::CCPoint v78; // [sp+5Ch] [bp-28h] BYREF
cocos2d::CCPoint v79; // [sp+64h] [bp-20h] BYREF
cocos2d::CCRect v80; // [sp+6Ch] [bp-18h] BYREF
if ( !a2 )
return nullptr;
v3 = (cocos2d::CCArray *)cocos2d::CCArray::count(a2);
if ( !v3 )
return nullptr;
v5 = 0;
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
v69 = (cocos2d::CCArray *)cocos2d::CCArray::create(v6);
cocos2d::CCArray::addObjectsFromArray(v6, a2);
while ( v5 < cocos2d::CCArray::count(v6) )
{
v7 = (float *)cocos2d::CCArray::objectAtIndex(v6, v5);
(*(void (__fastcall **)(_BYTE *, float *))(*(_DWORD *)v7 + 672))(v71, v7);
if ( (unsigned int)(*((_DWORD *)v7 + 221) - 1348) <= 3 )
{
cocos2d::CCPoint::CCPoint(&v72);
cocos2d::CCPoint::CCPoint(&v73);
cocos2d::CCPoint::CCPoint(&v74);
cocos2d::CCPoint::CCPoint(&v75);
switch ( *((_DWORD *)v7 + 221) )
{
case 0x544:
cocos2d::CCPoint::CCPoint(&v80.origin, 30.0, 0.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v72, COERCE_FLOAT(&v80), v10, v11);
cocos2d::CCPoint::CCPoint(&v80.origin, 30.0, -30.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v73, COERCE_FLOAT(&v80), v12, v13);
cocos2d::CCPoint::CCPoint(&v80.origin, 0.0, -30.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v74, COERCE_FLOAT(&v80), v14, v15);
v16 = -30.0;
v17 = 0.0;
goto LABEL_9;
case 0x545:
cocos2d::CCPoint::CCPoint(&v80.origin, -30.0, 0.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v72, COERCE_FLOAT(&v80), v47, v48);
cocos2d::CCPoint::CCPoint(&v80.origin, -30.0, -30.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v73, COERCE_FLOAT(&v80), v49, v50);
cocos2d::CCPoint::CCPoint(&v80.origin, 0.0, -30.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v74, COERCE_FLOAT(&v80), v51, v52);
v17 = -30.0;
goto LABEL_75;
case 0x546:
cocos2d::CCPoint::CCPoint(&v80.origin, 0.0, 30.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v72, COERCE_FLOAT(&v80), v53, v54);
cocos2d::CCPoint::CCPoint(&v80.origin, 30.0, 30.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v73, COERCE_FLOAT(&v80), v55, v56);
cocos2d::CCPoint::CCPoint(&v80.origin, 30.0, 0.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v74, COERCE_FLOAT(&v80), v57, v58);
v17 = 30.0;
LABEL_75:
v16 = 0.0;
goto LABEL_9;
case 0x547:
cocos2d::CCPoint::CCPoint(&v80.origin, 0.0, 30.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v72, COERCE_FLOAT(&v80), v59, v60);
cocos2d::CCPoint::CCPoint(&v80.origin, -30.0, 30.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v73, COERCE_FLOAT(&v80), v61, v62);
cocos2d::CCPoint::CCPoint(&v80.origin, -30.0, 0.0);
cocos2d::CCPoint::operator=((PlayerObject *)&v74, COERCE_FLOAT(&v80), v63, v64);
v17 = 0.0;
v16 = 30.0;
LABEL_9:
cocos2d::CCPoint::CCPoint(&v80.origin, v17, v16);
cocos2d::CCPoint::operator=((PlayerObject *)&v75, COERCE_FLOAT(&v80), v18, v19);
break;
default:
break;
}
v20 = 0;
cocos2d::CCPoint::operator+(&v76, v71, &v72);
cocos2d::CCPoint::operator+(&v77, v71, &v73);
cocos2d::CCPoint::operator+(&v78, v71, &v74);
v8 = 0;
v21 = 0;
v9 = 0;
cocos2d::CCPoint::operator+(&v79, v71, &v75);
v68 = 0;
v67 = 0;
while ( v20 < cocos2d::CCArray::count(v6) )
{
if ( v20 != v5 )
{
v65 = cocos2d::CCArray::objectAtIndex(v6, v20);
v66 = (const cocos2d::CCRect *)(*(int (__fastcall **)(int))(*(_DWORD *)v65 + 656))(v65);
cocos2d::CCRect::CCRect(&v80, v66);
if ( !v67 )
v67 = cocos2d::CCRect::containsPoint(&v80, &v76) != 0;
if ( !v68 )
v68 = cocos2d::CCRect::containsPoint(&v80, &v77) != 0;
if ( !v21 )
v21 = cocos2d::CCRect::containsPoint(&v80, &v78) != 0;
if ( !v8 )
v8 = cocos2d::CCRect::containsPoint(&v80, &v79) != 0;
}
if ( v67 && v68 && v21 || v9 )
{
v9 = 1;
if ( v8 )
break;
}
++v20;
}
}
else
{
v8 = 0;
v9 = 0;
}
cocos2d::CCPoint::CCPoint(&v77, &stru_AC77D0);
v22 = *((_DWORD *)v7 + 221);
if ( v22 == 1435 )
{
v8 = 0;
v23 = 1446;
}
else if ( v22 > 1435 )
{
if ( v22 == 1440 )
{
v8 = 0;
v23 = 1451;
}
else if ( v22 > 1440 )
{
if ( v22 == 1510 )
{
v8 = 0;
v23 = 1513;
}
else if ( v22 > 1510 )
{
if ( v22 == 1511 )
{
v8 = 0;
v23 = 1514;
}
else
{
if ( v22 != 1512 )
goto LABEL_70;
v8 = 0;
v23 = 1515;
}
}
else
{
if ( v22 != 1441 )
goto LABEL_70;
v8 = 0;
v23 = 1452;
}
}
else if ( v22 == 1437 )
{
v8 = 0;
v23 = 1448;
}
else if ( v22 < 1437 )
{
v8 = 0;
v23 = 1447;
}
else
{
v8 = 0;
if ( v22 == 1438 )
v23 = 1449;
else
v23 = 1450;
}
}
else if ( v22 == 1351 )
{
if ( v9 )
{
v8 = 0;
v23 = 1355;
}
else
{
v26 = v8 == 0;
v23 = 1390;
v8 = 1393;
if ( v26 )
v8 = 0;
}
}
else if ( v22 >= 1352 )
{
if ( v22 == 1432 )
{
v8 = 0;
v23 = 1443;
}
else if ( v22 > 1432 )
{
v8 = 0;
if ( v22 == 1433 )
v23 = 1444;
else
v23 = 1445;
}
else
{
if ( v22 != 1431 )
goto LABEL_70;
v8 = 0;
v23 = 1442;
}
}
else if ( v22 == 1349 )
{
if ( v9 )
{
v8 = 0;
v23 = 1353;
}
else
{
v23 = 1388;
if ( v8 )
v8 = 1392;
else
v8 = 0;
}
}
else if ( v22 > 1349 )
{
if ( v9 )
{
v8 = 0;
v23 = 1354;
}
else
{
v26 = v8 == 0;
v23 = 1389;
v8 = 1394;
if ( v26 )
v8 = 0;
}
}
else
{
if ( v22 != 1348 )
goto LABEL_70;
if ( v9 )
{
v8 = 0;
v23 = 1352;
}
else
{
if ( v8 )
{
cocos2d::CCPoint::CCPoint(&v80.origin, 0.0, -30.0);
v8 = 1391;
cocos2d::CCPoint::operator=((PlayerObject *)&v77, COERCE_FLOAT(&v80), v24, v25);
}
v23 = 1387;
}
}
(*(void (__fastcall **)(cocos2d::CCRect *, float *))(*(_DWORD *)v7 + 672))(&v80, v7);
LODWORD(v27.x) = &v80;
Object = EditorUI::createObject(a1, v23, v27);
setRotation = Object->setRotation;
v30 = (*(int (__fastcall **)(float *))(*(_DWORD *)v7 + 176))(v7);
((void (__fastcall *)(GameObject *, int))setRotation)(Object, v30);
setFlipX = Object->setFlipX;
v32 = (*(int (__fastcall **)(float *))(*(_DWORD *)v7 + 704))(v7);
setFlipX(Object, v32);
setFlipY = Object->setFlipY;
v34 = (*(int (__fastcall **)(float *))(*(_DWORD *)v7 + 708))(v7);
setFlipY(Object, v34);
GameObject::updateCustomScaleX(Object, v7[250]);
GameObject::updateCustomScaleY(Object, v7[251]);
Object->m_editorLayer2 = *((_WORD *)v7 + 515) + 2;
cocos2d::CCArray::addObject(v69, Object);
if ( v8 )
{
(*(void (__fastcall **)(cocos2d::CCPoint *, float *))(*(_DWORD *)v7 + 672))(&v78, v7);
EditorUI::offsetForKey(&v79, a1, v8);
cocos2d::CCPoint::operator+(&v80, &v78, &v79);
cocos2d::CCPoint::operator=((PlayerObject *)&v78, COERCE_FLOAT(&v80), v35, v36);
cocos2d::CCPoint::operator+(&v80, &v78, &v77);
cocos2d::CCPoint::operator=((PlayerObject *)&v78, COERCE_FLOAT(&v80), v37, v38);
cocos2d::CCPoint::CCPoint(&v80.origin, &v78);
LODWORD(v39.x) = &v80;
v40 = EditorUI::createObject(a1, v8, v39);
v41 = v40->setRotation;
v42 = (*(int (__fastcall **)(float *))(*(_DWORD *)v7 + 176))(v7);
((void (__fastcall *)(GameObject *, int))v41)(v40, v42);
v43 = v40->setFlipX;
v44 = (*(int (__fastcall **)(float *))(*(_DWORD *)v7 + 704))(v7);
v43(v40, v44);
v45 = v40->setFlipY;
v46 = (*(int (__fastcall **)(float *))(*(_DWORD *)v7 + 708))(v7);
v45(v40, v46);
GameObject::updateCustomScaleX(v40, v7[250]);
GameObject::updateCustomScaleY(v40, v7[251]);
v40->m_editorLayer2 = *((_WORD *)v7 + 515) + 2;
cocos2d::CCArray::addObject(v69, v40);
}
LABEL_70:
++v5;
}
return v69;
}