//
// EditorWindowPopup::clampWindowCenter from 0xcd8c5c to 0xcd8d78 (284 bytes)
//
// 5 xrefs:
// > EditorWindowPopup::ccTouchMoved @ 0xcd9080
// > EditorWindowPopup::ccTouchEnded @ 0xcd92a4
// > EditorWindowPopup::ccTouchCancelled @ 0xcd93e8
// > EditorWindowPopup::initWindow @ 0xcd98f4
// > ??> @ 0x84c28
//
// 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:06:31 +0000
//
cocos2d::CCPoint *__usercall EditorWindowPopup::clampWindowCenter@(
__int64 a1@,
float *a2@,
cocos2d::CCPoint *a3@)
{
__int64 v4; // x2
float v5; // s8
float v6; // s9
float v7; // s10
float v8; // s8
cocos2d::CCDirector *v9; // x0
cocos2d::CCDirector *ScreenBottom; // x0
float v11; // s0
float v12; // s10
float v13; // s8
cocos2d::CCDirector *v14; // x0
cocos2d::CCDirector *ScreenTop; // x0
float v16; // s0
float v17; // s13
float v18; // s11
cocos2d::CCDirector *v19; // x0
cocos2d::CCDirector *ScreenLeft; // x0
float v21; // s9
float v22; // s0
float v23; // s12
cocos2d::CCDirector *v24; // x0
float v25; // s0
float v26; // s0
float v27; // s10
float v29; // s0
v4 = *(_QWORD *)(a1 + 1016);
v5 = *(float *)(a1 + 1064);
v6 = v5 * *(float *)(a1 + 1056);
v7 = v5 * *(float *)(a1 + 1060);
if ( v4 )
v8 = *(float *)(v4 + 856);
else
v8 = 0.0;
v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)a1);
ScreenBottom = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenBottom(v9);
v12 = v7 * 0.5;
v13 = (float)((float)((float)(v8 + v11) + 10.0) - v12) + 6.0;
v14 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenBottom);
ScreenTop = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenTop(v14);
v17 = v16;
v18 = v6 * 0.3;
v19 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenTop);
ScreenLeft = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenLeft(v19);
v21 = v6 * 0.5;
v23 = (float)(v22 - v21) + v18;
v24 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenLeft);
cocos2d::CCDirector::getScreenRight(v24);
if ( v23 > *a2 )
{
*a2 = v23;
goto LABEL_5;
}
v29 = (float)(v21 + v25) - v18;
if ( v29 >= *a2 )
{
LABEL_5:
v26 = a2[1];
if ( v13 <= v26 )
goto LABEL_6;
LABEL_11:
a2[1] = v13;
goto LABEL_8;
}
*a2 = v29;
v26 = a2[1];
if ( v13 > v26 )
goto LABEL_11;
LABEL_6:
v27 = v17 - v12;
if ( v27 < v26 )
a2[1] = v27;
LABEL_8:
cocos2d::CCPoint::CCPoint(a3, (const cocos2d::CCPoint *)a2);
return a3;
}