//
// cocos2d::CCDirector::updateContentScale from 0x1800c0080 to 0x1800c01ba (314 bytes)
//
// 5 xrefs:
// > cocos2d::CCDirector::setupScreenScale @ 0x1800bfcb0
// > ??> @ 0x180141f5c
// > ??> @ 0x180141f6c
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b9414
//
// 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::CCDirector::updateContentScale(cocos2d::CCDirector *this, enum cocos2d::TextureQuality a2)
{
int v2; // edx
int v3; // edx
float height; // xmm7_4
float width; // xmm8_4
float m_fContentScaleFactor; // xmm0_4
v2 = a2 - 1;
if ( !v2 )
{
LABEL_12:
m_fContentScaleFactor = this->m_fContentScaleFactor;
if ( m_fContentScaleFactor != 1.0 )
{
m_fContentScaleFactor = 1.0;
this->m_fContentScaleFactor = 1.0;
}
goto LABEL_14;
}
v3 = v2 - 1;
if ( !v3 )
goto LABEL_8;
if ( v3 != 1 )
{
height = this->m_obResolutionInPixels.height;
if ( height < (float)(this->m_obScaleFactor.height * 3.0) )
{
width = this->m_obResolutionInPixels.width;
if ( width < (float)(this->m_obScaleFactor.width * 3.0) )
{
if ( height >= (float)(this->m_obScaleFactor.height * 1.5)
|| width >= (float)(this->m_obScaleFactor.width * 1.5) )
{
LABEL_8:
m_fContentScaleFactor = this->m_fContentScaleFactor;
if ( m_fContentScaleFactor != 2.0 )
{
this->m_fContentScaleFactor = 2.0;
m_fContentScaleFactor = 2.0;
}
goto LABEL_14;
}
goto LABEL_12;
}
}
}
m_fContentScaleFactor = this->m_fContentScaleFactor;
if ( m_fContentScaleFactor != 4.0 )
{
this->m_fContentScaleFactor = 4.0;
m_fContentScaleFactor = 4.0;
}
LABEL_14:
if ( m_fContentScaleFactor == 4.0 )
{
this->m_eTextureQuality = kTextureQualityHigh;
}
else if ( m_fContentScaleFactor == 2.0 )
{
this->m_eTextureQuality = kTextureQualityMedium;
}
else if ( m_fContentScaleFactor == 1.0 )
{
this->m_eTextureQuality = kTextureQualityLow;
}
}