//
// cocos2d::CCEGLViewProtocol::updateDesignResolutionSize from 0xb0a204 to 0xb0a348 (324 bytes)
//
// 1 xrefs:
// > ??> @ 0xa0c38
//
// 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; // s0
float height; // s4
float v3; // s2
float v4; // s3
float v5; // s5
cocos2d::ResolutionPolicy m_eResolutionPolicy; // w1
float v7; // s1
cocos2d::CCDirector *v9; // x20
cocos2d::CCSize *v10; // x0
width = a1->m_obScreenSize.width;
if ( width > 0.0 )
{
height = a1->m_obScreenSize.height;
if ( height > 0.0 )
{
v3 = a1->m_obDesignResolutionSize.width;
if ( v3 > 0.0 )
{
v4 = a1->m_obDesignResolutionSize.height;
if ( v4 > 0.0 )
{
v5 = width / v3;
m_eResolutionPolicy = a1->m_eResolutionPolicy;
v7 = height / v4;
a1->m_fScaleX = width / v3;
a1->m_fScaleY = height / v4;
if ( m_eResolutionPolicy == kResolutionNoBorder )
{
if ( v5 >= v7 )
{
LABEL_16:
v7 = width / v3;
a1->m_fScaleY = v5;
a1->m_fScaleX = v5;
goto LABEL_10;
}
}
else
{
if ( m_eResolutionPolicy != kResolutionShowAll )
{
if ( m_eResolutionPolicy == kResolutionFixedHeight )
{
a1->m_fScaleX = v7;
v5 = height / v4;
v3 = ceilf(width / v7);
a1->m_obDesignResolutionSize.width = v3;
}
else if ( m_eResolutionPolicy == kResolutionFixedWidth )
{
v7 = width / v3;
a1->m_fScaleY = v5;
v4 = ceilf(height / v5);
a1->m_obDesignResolutionSize.height = v4;
}
goto LABEL_10;
}
if ( v5 <= v7 )
goto LABEL_16;
}
a1->m_fScaleY = v7;
a1->m_fScaleX = v7;
v5 = height / v4;
LABEL_10:
cocos2d::CCRect::setRect(
&a1->m_obViewPortRect,
(float)(width - (float)(v3 * v5)) * 0.5,
(float)(height - (float)(v4 * v7)) * 0.5,
v3 * v5,
v4 * v7);
v9 = cocos2d::CCDirector::sharedDirector();
v10 = (cocos2d::CCSize *)a1->getDesignResolutionSize(a1);
cocos2d::CCSize::operator=(&v9->m_obWinSizeInPoints, (float *)v10);
cocos2d::CCDirector::createStatsLabel(v9);
cocos2d::CCDirector::setGLDefaultValues(v9);
}
}
}
}
}