//
// EditorUI::flipObjectsY from 0x385bc0 to 0x385ce0 (288 bytes)
//
// 2 xrefs:
// > EditorUI::transformObjectCall @ 0x39ff72
// > EditorUI::createSmartObjectsFromTemplate @ 0x3a538a
//
// 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 EditorUI::flipObjectsY(EditorUI *a1, cocos2d::CCArray *a2)
{
unsigned int v4; // r4
float v5; // s16
float v6; // s18
GameObject *v7; // r9
float v8; // s19
float v9; // r0
float v10; // s17
unsigned int v11; // r5
GameObject *v12; // r0
GameObject *v13; // r4
float y; // s17
float *v15; // r0
int v16; // r0
cocos2d::CCPoint v17; // r2
cocos2d::CCPoint v18; // [sp+4h] [bp-1Ch] BYREF
cocos2d::CCRect v19; // [sp+Ch] [bp-14h] BYREF
v4 = 0;
v5 = -9999.0;
v6 = -9999.0;
while ( v4 < cocos2d::CCArray::count(a2) )
{
v7 = (GameObject *)cocos2d::CCArray::objectAtIndex(a2, v4);
GameObject::updateStartPos(v7);
((void (__fastcall *)(cocos2d::CCRect *, GameObject *, int, int))v7->getObjectRect_0)(
&v19,
v7,
1065353216,
1065353216);
v8 = COERCE_FLOAT(cocos2d::CCRect::getMaxY(&v19));
v9 = COERCE_FLOAT(cocos2d::CCRect::getMinY(&v19));
if ( v8 > v6 )
v6 = v8;
v10 = v9;
if ( v9 >= v5 && v5 != -9999.0 )
v10 = v5;
EditorUI::transformObject(a1, v7, FlipY, 1);
++v4;
v5 = v10;
}
v11 = 0;
while ( v11 < cocos2d::CCArray::count(a2) )
{
v12 = (GameObject *)cocos2d::CCArray::objectAtIndex(a2, v11++);
v13 = v12;
y = v12->getPosition(v12)->y;
v15 = (float *)v13->getPosition(v13);
cocos2d::CCPoint::CCPoint(&v18, *v15, v6 - (float)(y - v5));
v16 = (int)v13->getPosition(v13);
cocos2d::CCPoint::operator-(&v19, &v18, v16);
LODWORD(v17.x) = &v19;
EditorUI::moveObject(a1, v13, v17);
}
}