//
// SupportLayer::onLowDetail from 0x7db718 to 0x7db86c (340 bytes)
//
// 3 xrefs:
// > ??> @ 0x87d38
// > SupportLayer::customSetup @ 0x7dd5b4
// > ??> @ 0x122c960
//
// 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 SupportLayer::onLowDetail(SupportLayer *a1, cocos2d::CCObject *a2)
{
GameManager *v2; // x0
GameManager *v3; // x20
FLAlertLayer *v4; // x20
void *v5; // x0
unsigned int *v6; // x2
int v7; // w1
__int64 v8; // [xsp+30h] [xbp+30h] BYREF
v2 = GameManager::sharedState();
GameManager::unloadBackground(v2);
v3 = GameManager::sharedState();
v3->m_performanceMode = !GameManager::sharedState()->m_performanceMode;
if ( !GameManager::sharedState()->m_showedLowDetailDialog )
{
GameManager::sharedState()->m_showedLowDetailDialog = 1;
sub_D153B8((int)&v8, "Low detail mode disables a lot of visual effects to increase performance.");
v4 = FLAlertLayer::create(0, (__int64)"Low Detail Mode", (__int64)&v8);
v5 = (void *)(v8 - 24);
if ( (__int64 *)(v8 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v8 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v8 - 8);
*(_DWORD *)(v8 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v5);
}
v4->show(v4);
}
}