//
// VideoOptionsLayer::updateResolution from 0x140378120 to 0x140378221 (257 bytes)
//
// 4 xrefs:
// > VideoOptionsLayer::init @ 0x140377d26
// > VideoOptionsLayer::onResolutionPrev @ 0x140378108
// > VideoOptionsLayer::onResolutionNext @ 0x140378118
// > ??> @ 0x1406d5c24
//
// 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
//
// Hidden C++ exception states: #wind=1
void VideoOptionsLayer::updateResolution(VideoOptionsLayer *a1, int a2)
{
int v4; // eax
cocos2d::CCString *v5; // rax
GameManager *v6; // rcx
cocos2d::CCLabelProtocol_vtbl *v7; // rbx
cocos2d::CCString *v8; // rax
const char *CString; // rax
float v10; // [rsp+30h] [rbp+8h] BYREF
float v11; // [rsp+34h] [rbp+Ch]
void *v12; // [rsp+40h] [rbp+18h]
v4 = cocos2d::CCArray::count(a1->m_availableResolutions);
if ( a2 < v4 )
{
if ( a2 < 0 )
a2 = v4 - 1;
}
else
{
a2 = 0;
}
a1->m_currentResolution = a2;
v5 = cocos2d::CCArray::stringAtIndex(a1->m_availableResolutions, a2);
cocos2d::CCString::intValue(v5);
if ( !qword_1406C2ED8 )
{
v12 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
}
GameManager::resolutionForKey(v6, (int)&v10);
v7 = a1->m_selectedResolutionLabel->__vftable;
v8 = cocos2d::CCString::createWithFormat("%ix%i", (int)v10, (int)v11);
CString = cocos2d::CCString::getCString(v8);
v7->setString(&a1->m_selectedResolutionLabel->cocos2d::CCLabelProtocol, CString);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_selectedResolutionLabel, 100.0, 0.75, 0.0);
VideoOptionsLayer::toggleResolution(a1);
}