//
// GameManager::loadBackground from 0x322734 to 0x322790 (92 bytes)
//
// 2 xrefs:
// > GameManager::getBGTexture @ 0x322c10
// > LevelSettingsLayer::selectArtClosed @ 0x56f94c
//
// 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 GameManager::loadBackground(GameManager *a1, int a2)
{
const char *v3; // r4
const char *m_loadedBgID; // r1
cocos2d::CCString *v5; // r0
const char *CString; // r6
cocos2d::CCTextureCache *v7; // r0
cocos2d::CCString *v8; // r0
const char *v9; // r6
cocos2d::CCTextureCache *v10; // r0
if ( a2 <= 0 )
{
v3 = (_BYTE *)(&dword_0 + 1);
}
else
{
if ( a2 >= 59 )
a2 = (int)&dword_38 + 3;
v3 = (const char *)a2;
}
m_loadedBgID = (const char *)a1->m_loadedBgID;
if ( v3 != m_loadedBgID )
{
if ( m_loadedBgID )
{
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"game_bg_%02d_001.png",
m_loadedBgID);
CString = cocos2d::CCString::getCString(v5);
v7 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v7, CString);
}
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"game_bg_%02d_001.png", v3);
v9 = cocos2d::CCString::getCString(v8);
AppDelegate::get();
v10 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v10, v9, 0);
a1->m_loadedBgID = (int)v3;
}
}