//
// cocos2d::CCEGLViewProtocol::setDesignResolutionSize from 0x1002e6aa0 to 0x1002e6bb8 (280 bytes)
//
// 2 xrefs:
// > ??> @ 0x100791878
// > ??> @ 0x1007e5650
//
// 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 __fastcall cocos2d::CCEGLViewProtocol::setDesignResolutionSize(__int64 a1, int a2, float a3, float a4)
{
float v6; // s0
float v7; // s1
float v8; // s2
float v9; // s3
float v10; // s5
float v11; // s4
double *v12; // x19
cocos2d::CCDirector *v13; // x0
cocos2d::CCDirector *v14; // x0
cocos2d::CCDirector *v15; // x0
if ( a3 != 0.0 && a4 != 0.0 )
{
sub_100022B20((float *)(a1 + 24), a3, a4);
v6 = *(float *)(a1 + 16);
v7 = *(float *)(a1 + 20);
v8 = *(float *)(a1 + 24);
v9 = *(float *)(a1 + 28);
v10 = v6 / v8;
v11 = v7 / v9;
*(float *)(a1 + 100) = v6 / v8;
*(float *)(a1 + 104) = v7 / v9;
if ( a2 > 2 )
{
if ( a2 != 3 )
{
if ( a2 == 4 )
{
*(float *)(a1 + 104) = v10;
v9 = ceilf(v7 / v10);
*(float *)(a1 + 28) = v9;
v11 = v6 / v8;
}
goto LABEL_18;
}
*(float *)(a1 + 100) = v11;
v8 = ceilf(v6 / v11);
*(float *)(a1 + 24) = v8;
}
else
{
if ( a2 == 1 )
{
if ( v10 >= v11 )
v11 = v6 / v8;
}
else
{
if ( a2 != 2 )
{
LABEL_18:
sub_100022B70(
(float *)(a1 + 32),
(float)(v6 - (float)(v8 * v10)) * 0.5,
(float)(v7 - (float)(v9 * v11)) * 0.5,
v8 * v10,
v9 * v11);
*(_DWORD *)(a1 + 108) = a2;
v12 = (double *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 88LL))(a1);
v13 = cocos2d::CCDirector::sharedDirector();
sub_100022B14(&v13->m_obWinSizeInPoints, v12);
v14 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::createStatsLabel(v14);
v15 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::setGLDefaultValues(v15);
return;
}
if ( v10 <= v11 )
v11 = v6 / v8;
}
*(float *)(a1 + 100) = v11;
*(float *)(a1 + 104) = v11;
}
v10 = v11;
goto LABEL_18;
}
}