//
// GameManager::loadBackground from 0x4146dc to 0x414738 (92 bytes)
//
// 2 xrefs:
// > GameManager::getBGTexture @ 0x414bb8
// > LevelSettingsLayer::selectArtClosed @ 0x6a8bc8
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:47:39 +0000
//
int __fastcall GameManager::loadBackground(int this, const char *a2)
{
int v2; // r5
const char *v3; // r4
const char *v4; // r1
cocos2d::CCString *v5; // r0
cocos2d::CCTextureCache *CString; // r6
cocos2d::CCTextureCache *v7; // r0
cocos2d::CCString *v8; // r0
AppDelegate *v9; // r6
cocos2d::CCTextureCache *v10; // r0
cocos2d::CCTextureCache *v11; // r0
v2 = this;
if ( (int)a2 <= 0 )
{
v3 = (_BYTE *)(&dword_0 + 1);
}
else
{
if ( (int)a2 >= 59 )
a2 = (char *)&dword_38 + 3;
v3 = a2;
}
v4 = *(const char **)(this + 768);
if ( v3 != v4 )
{
if ( v4 )
{
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"game_bg_%02d_001.png", v4);
CString = (cocos2d::CCTextureCache *)cocos2d::CCString::getCString(v5);
v7 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(CString);
cocos2d::CCTextureCache::removeTextureForKey(v7, (const char *)CString);
}
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"game_bg_%02d_001.png", v3);
v9 = (AppDelegate *)cocos2d::CCString::getCString(v8);
v10 = (cocos2d::CCTextureCache *)AppDelegate::get(v9);
v11 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v10);
this = cocos2d::CCTextureCache::addImage(v11, (const char *)v9, 0);
*(_DWORD *)(v2 + 768) = v3;
}
return this;
}