//
// VideoOptionsLayer::onApply from 0x1000f0d2c to 0x1000f0f10 (484 bytes)
//
// 1 xrefs:
// > VideoOptionsLayer::init @ 0x1000f0754
//
// 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 VideoOptionsLayer::onApply(VideoOptionsLayer *a1, cocos2d::CCObject *a2)
{
cocos2d::CCString *v3; // x0
int v4; // w20
GameManager *v5; // x0
GameManager *v6; // x0
GameManager *v7; // x0
GameManager *v8; // x0
__int64 v9; // x19
cocos2d::CCDirector *v10; // x20
cocos2d::CCScene *v11; // x0
GameManager *v12; // x0
GameManager *v13; // x0
cocos2d::TextureQuality m_eTextureQuality; // w20
cocos2d::CCDirector *v15; // x0
cocos2d::TextureQuality v16; // w19
GameManager *v17; // x0
void *__p[2]; // [xsp+0h] [xbp-30h] BYREF
char v19; // [xsp+17h] [xbp-19h]
float v20; // [xsp+18h] [xbp-18h]
float v21; // [xsp+1Ch] [xbp-14h]
v3 = cocos2d::CCArray::stringAtIndex(a1->m_availableResolutions, a1->m_currentResolution);
v4 = cocos2d::CCString::intValue(v3);
v5 = GameManager::sharedState();
GameManager::resolutionForKey(v5, v4);
v6 = GameManager::sharedState();
if ( a1->m_fullscreen != GameManager::getGameVariable(v6, "0025")
&& (!a1->m_fullscreen
|| (v7 = GameManager::sharedState(), a1->m_borderless == GameManager::getGameVariable(v7, "0170"))
&& (v8 = GameManager::sharedState(), a1->m_fix == GameManager::getGameVariable(v8, "0175")))
&& GameManager::sharedState()->m_resolution == v4
&& GameManager::sharedState()->m_texQuality == a1->m_textureQuality )
{
sub_100009900(__p, "No changes have been made.");
v9 = sub_1002ABCCC(0, "Graphics", __p, "OK", 0);
if ( v19 < 0 )
operator delete(__p[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 1288LL))(v9);
}
else
{
GameManager::sharedState();
GameManager::sharedState()->m_resolution = v4;
GameManager::sharedState()->m_texQuality = a1->m_textureQuality;
v10 = cocos2d::CCDirector::sharedDirector();
v11 = cocos2d::CCScene::create();
cocos2d::CCDirector::replaceScene(v10, v11);
PlatformToolbox::resizeWindow(v20, v21);
v12 = GameManager::sharedState();
if ( a1->m_fullscreen == GameManager::getGameVariable(v12, "0025") )
{
v13 = GameManager::sharedState();
GameManager::setGameVariable(v13, "0025", !a1->m_fullscreen);
PlatformToolbox::toggleFullScreen(a1->m_fullscreen, a1->m_borderless, a1->m_fix);
}
m_eTextureQuality = cocos2d::CCDirector::sharedDirector()->m_eTextureQuality;
v15 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::updateContentScale(v15, (cocos2d::TextureQuality)a1->m_textureQuality);
v16 = cocos2d::CCDirector::sharedDirector()->m_eTextureQuality;
v17 = GameManager::sharedState();
if ( m_eTextureQuality == v16 )
GameManager::queueReloadMenu(v17);
else
GameManager::reloadAll(v17, 0, 0, 0, 0, 1);
}
}