//
// GameManager::loadBackground from 0x1401828a0 to 0x14018294b (171 bytes)
//
// 9 xrefs:
// > GauntletLayer::init @ 0x1401f6225
// > GJBaseGameLayer::createBackground @ 0x14020b902
// > LevelAreaLayer::init @ 0x1402c463e
// > LevelSettingsLayer::selectArtClosed @ 0x140321ed6
// > LoadingLayer::init @ 0x14032e67d
// > MenuGameLayer::init @ 0x140331512
// > ??> @ 0x140677a9c
// > ??> @ 0x140677aac
// > ??> @ 0x1406cb46c
//
// 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)
{
int v2; // eax
int v3; // edi
int m_loadedBgID; // edx
cocos2d::CCString *v6; // rax
const char *CString; // rbx
cocos2d::CCTextureCache *v8; // rax
cocos2d::CCString *v9; // rax
const char *v10; // rbx
__int64 v11; // rdx
__int64 v12; // rcx
cocos2d::CCTextureCache *v13; // rax
v2 = 59;
v3 = 1;
if ( a2 < 59 )
v2 = a2;
m_loadedBgID = a1->m_loadedBgID;
if ( v2 > 1 )
v3 = v2;
if ( v3 != m_loadedBgID )
{
if ( m_loadedBgID )
{
v6 = cocos2d::CCString::createWithFormat("game_bg_%02d_001.png", m_loadedBgID);
CString = cocos2d::CCString::getCString(v6);
v8 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v8, CString);
}
v9 = cocos2d::CCString::createWithFormat("game_bg_%02d_001.png", v3);
v10 = cocos2d::CCString::getCString(v9);
cocos2d::CCApplication::sharedApplication(v12, v11);
v13 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v13, v10, 0);
a1->m_loadedBgID = v3;
}
}