//
// GameManager::unloadBackground from 0x716778 to 0x716814 (156 bytes)
//
// 2 xrefs:
// > SupportLayer::onLowDetail @ 0x901eec
// > ??> @ 0xf0b08
//
// 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:52:16 +0000
//
__int64 __fastcall GameManager::unloadBackground(__int64 this)
{
const char *v1; // x1
__int64 v2; // x21
unsigned int v3; // w19
cocos2d::CCString *v4; // x0
cocos2d::CCTextureCache *v5; // x0
const char *v6; // x1
cocos2d::CCString *v7; // x0
__int64 v8; // x0
char *CString; // [xsp+38h] [xbp+38h]
char *v10; // [xsp+38h] [xbp+38h]
v1 = (const char *)*(unsigned int *)(this + 980);
if ( (_DWORD)v1 )
{
v2 = this;
v3 = 1;
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"game_bg_%02d_001.png", v1);
CString = (char *)cocos2d::CCString::getCString(v4);
v5 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)CString);
cocos2d::CCTextureCache::removeTextureForKey(v5, CString);
*(_DWORD *)(v2 + 980) = 0;
do
{
v6 = (const char *)v3++;
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"game_bg_%02d_001.png", v6);
v10 = (char *)cocos2d::CCString::getCString(v7);
v8 = cocos2d::CCFileUtils::sharedFileUtils((cocos2d::CCFileUtils *)v10);
this = (*(__int64 (__fastcall **)(__int64, char *))(*(_QWORD *)v8 + 56LL))(v8, v10);
}
while ( v3 != 60 );
}
return this;
}