//
// cocos2d::CCEGLViewProtocol::updateDesignResolutionSize from 0x5e0acc to 0x5e0bfa (302 bytes)
//
// 0 xrefs:
//
// 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 cocos2d::CCEGLViewProtocol::updateDesignResolutionSize(cocos2d::CCEGLViewProtocol *a1)
{
float width; // s17
float height; // s16
float v4; // s14
float v5; // s15
float v6; // s14
cocos2d::ResolutionPolicy m_eResolutionPolicy; // r3
float v8; // s15
float v9; // r3
cocos2d::CCDirector *v10; // r5
cocos2d::CCSize *v11; // r0
float v12; // [sp+0h] [bp-Ch]
width = a1->m_obScreenSize.width;
if ( width > 0.0 )
{
height = a1->m_obScreenSize.height;
if ( height > 0.0 )
{
v4 = a1->m_obDesignResolutionSize.width;
if ( v4 > 0.0 )
{
v5 = a1->m_obDesignResolutionSize.height;
if ( v5 > 0.0 )
{
v6 = width / v4;
m_eResolutionPolicy = a1->m_eResolutionPolicy;
v8 = height / v5;
a1->m_fScaleX = v6;
a1->m_fScaleY = v8;
if ( m_eResolutionPolicy == kResolutionNoBorder )
{
if ( v6 >= v8 )
v8 = v6;
}
else
{
if ( m_eResolutionPolicy != kResolutionShowAll )
{
if ( m_eResolutionPolicy == kResolutionFixedHeight )
{
a1->m_fScaleX = v8;
a1->m_obDesignResolutionSize.width = ceilf(width / v8);
}
else if ( m_eResolutionPolicy == kResolutionFixedWidth )
{
a1->m_fScaleY = v6;
a1->m_obDesignResolutionSize.height = ceilf(height / v6);
}
goto LABEL_17;
}
if ( v6 <= v8 )
v8 = v6;
}
a1->m_fScaleY = v8;
a1->m_fScaleX = v8;
LABEL_17:
v9 = a1->m_obDesignResolutionSize.width * a1->m_fScaleX;
v12 = a1->m_obDesignResolutionSize.height * a1->m_fScaleY;
cocos2d::CCRect::setRect(
&a1->m_obViewPortRect,
(float)(width - v9) * 0.5,
(float)(height - v12) * 0.5,
v9,
v12);
v10 = cocos2d::CCDirector::sharedDirector();
v11 = (cocos2d::CCSize *)a1->getDesignResolutionSize(a1);
cocos2d::CCSize::operator=(&v10->m_obWinSizeInPoints, &v11->width);
cocos2d::CCDirector::createStatsLabel(v10);
cocos2d::CCDirector::setGLDefaultValues(v10);
}
}
}
}
}