//
// GameManager::loadBackgroundAsync from 0x5ebeb4 to 0x5ebf4c (152 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::swapBackground @ 0x8580a8
// > ??> @ 0x6cf00
//
// 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::loadBackgroundAsync(GameManager *a1, int a2)
{
unsigned int v2; // w19
cocos2d::CCTextureCache *v3; // x20
cocos2d::CCString *v4; // x0
const char *CString; // x0
cocos2d::SEL_MenuHandler v7; // 0:x3.16
if ( a2 <= 0 )
{
v2 = 1;
}
else if ( a2 > 59 )
{
v2 = 59;
}
else
{
v2 = a2;
}
if ( !a1->m_loadingBG && v2 != a1->m_loadedBgID )
{
a1->m_loadingBG = (unsigned __int8)&dword_0 + 1;
v3 = cocos2d::CCTextureCache::sharedTextureCache();
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"game_bg_%02d_001.png",
(const char *)v2);
CString = cocos2d::CCString::getCString(v4);
v7.adj = 0;
v7.ptr = (void (__cdecl *)(cocos2d::CCObject *))GameManager::finishedLoadingBGAsync;
cocos2d::CCTextureCache::addImageAsync(v3, CString, a1, v7, v2, kCCTexture2DPixelFormat_RGBA8888);
}
}