//
// VideoOptionsLayer::updateResolution from 0x8ef310 to 0x8ef408 (248 bytes)
//
// 4 xrefs:
// > VideoOptionsLayer::onResolutionPrev @ 0x8ef414
// > VideoOptionsLayer::onResolutionNext @ 0x8ef420
// > VideoOptionsLayer::init @ 0x8f570c
// > ??> @ 0xff778
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:56:57 +0000
//
__int64 __fastcall VideoOptionsLayer::updateResolution(cocos2d::CCArray **this, signed int a2)
{
signed int v4; // w0
unsigned int v5; // w1
cocos2d::CCArray *v6; // x0
cocos2d::CCString *v7; // x0
GameManager *v8; // x0
__int64 v9; // x21
void (__fastcall *v10)(__int64, __int64); // x22
cocos2d::CCString *v11; // x0
__int64 CString; // x0
int v14; // [xsp+38h] [xbp+38h]
float v15[2]; // [xsp+40h] [xbp+40h] BYREF
v4 = cocos2d::CCArray::count(*(this + 89));
if ( v4 <= a2 )
{
v5 = 0;
a2 = 0;
}
else
{
if ( a2 < 0 )
a2 = v4 - 1;
v5 = a2;
}
v6 = *(this + 89);
*((_DWORD *)this + 189) = a2;
v7 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v6, v5);
v8 = (GameManager *)cocos2d::CCString::intValue(v7);
v14 = (int)v8;
GameManager::sharedState(v8);
GameManager::resolutionForKey(v14, (cocos2d::CCSize *)v15);
v9 = (__int64)*(this + 86);
v10 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 928LL);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%ix%i",
(const char *)(unsigned int)(int)v15[0],
(unsigned int)(int)v15[1]);
CString = cocos2d::CCString::getCString(v11);
v10(v9, CString);
cocos2d::CCLabelBMFont::limitLabelWidth(*(this + 86), 100.0, 0.75, 0.0);
VideoOptionsLayer::toggleResolution((VideoOptionsLayer *)this);
return _stack_chk_guard;
}