//
// cocos2d::CCDirector::updateScreenScale from 0x1800c01c0 to 0x1800c02a0 (224 bytes)
//
// 4 xrefs:
// > cocos2d::CCEGLView::updateWindow @ 0x180079287
// > cocos2d::CCDirector::setupScreenScale @ 0x1800bfc97
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b9438
//
// 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
//
__int64 __fastcall cocos2d::CCDirector::updateScreenScale(cocos2d::CCDirector *this, struct cocos2d::CCSize a2)
{
unsigned int v3; // edi
struct cocos2d::CCEGLView *v4; // rax
__int64 v5; // r8
struct cocos2d::CCDirector *v6; // rax
float v7; // xmm1_4
float v9; // xmm2_4
float v10; // xmm1_4
float v11; // xmm2_4
float v12; // [rsp+30h] [rbp+8h] BYREF
float v13; // [rsp+34h] [rbp+Ch]
cocos2d::CCSize::operator=(&this->m_obResolutionInPixels, *(_DWORD **)&a2);
v3 = 3;
if ( (float)(this->m_obResolutionInPixels.height / this->m_obScaleFactor.height) > (float)(this->m_obResolutionInPixels.width
/ this->m_obScaleFactor.width) )
v3 = 4;
v4 = cocos2d::CCEGLView::sharedOpenGLView();
((void (__fastcall *)(struct cocos2d::CCEGLView *, cocos2d::CCEGLView_vtbl *, __int64, _QWORD))v4->setDesignResolutionSize)(
v4,
v4->__vftable,
v5,
v3);
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::cc_timeval::operator=(&v12, &v6->m_obWinSizeInPoints);
v7 = v12;
v9 = v13;
this->m_fScreenRight = v12;
v10 = v7 / this->m_obScaleFactor.width;
*(_QWORD *)&this->m_fScreenBottom = 0;
this->m_fScreenTop = v9;
v11 = v9 / this->m_obScaleFactor.height;
this->m_fScreenScaleFactorW = v10;
this->m_fScreenScaleFactorH = v11;
this->m_fScreenScaleFactor = fminf(v10, v11);
this->m_fScreenScaleFactorMax = fmaxf(v10, v11);
return 0;
}