//
// GameLevelManager::deleteLevelList from 0x6f5724 to 0x6f5848 (292 bytes)
//
// 4 xrefs:
// > LevelBrowserLayer::FLAlert_Clicked @ 0x6ed47c
// > LevelListLayer::onFavorite @ 0xa7274c
// > LevelListLayer::onDelete @ 0xa77eb8
// > ??> @ 0xac278
//
// 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 GameLevelManager::deleteLevelList(GameLevelManager *a1, GJLevelList *a2)
{
cocos2d::CCDictionary *m_favoriteLists; // x21
char *LevelListKey; // x0
char *v4; // x0
LocalLevelManager *v5; // x0
unsigned int *v6; // x2
int v7; // w1
std::string v9; // [xsp+50h] [xbp+50h] BYREF
if ( a2->m_listType == Editor )
{
v5 = LocalLevelManager::sharedState();
cocos2d::CCArray::removeObject(v5->m_localLists, a2, 1);
}
else
{
m_favoriteLists = a1->m_favoriteLists;
LevelListKey = (char *)GameLevelManager::getLevelListKey(a1, a2->m_listID);
sub_D153B8((int)&v9, LevelListKey);
cocos2d::CCDictionary::removeObjectForKey(m_favoriteLists, &v9);
v4 = (char *)v9.m_data.m_data - 24;
if ( (__int64 *)v9.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)((char *)v9.m_data.m_data - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *((_DWORD *)v9.m_data.m_data - 2);
*((_DWORD *)v9.m_data.m_data - 2) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v4);
}
}
}