//
// GameManager::loadBackgroundAsync from 0x322798 to 0x3227f0 (88 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::swapBackground @ 0x46dc2c
//
// 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)
{
const char *v3; // r4
size_t m_loadingBG; // r6
cocos2d::CCTextureCache *v5; // r7
cocos2d::CCString *v6; // r0
const char *CString; // r0
cocos2d::SEL_MenuHandler v8; // 0:r3.4,4:^0.4
if ( a2 <= 0 )
{
v3 = (_BYTE *)(&dword_0 + 1);
}
else
{
if ( a2 >= 59 )
a2 = 59;
v3 = (const char *)a2;
}
m_loadingBG = a1->m_loadingBG;
if ( !a1->m_loadingBG && v3 != (const char *)a1->m_loadedBgID )
{
a1->m_loadingBG = 1;
v5 = cocos2d::CCTextureCache::sharedTextureCache();
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"game_bg_%02d_001.png", v3);
CString = cocos2d::CCString::getCString(v6);
v8.ptr = (void (__cdecl *)(cocos2d::CCObject *))GameManager::finishedLoadingBGAsync;
v8.adj = m_loadingBG;
cocos2d::CCTextureCache::addImageAsync(v5, CString, a1, v8, (int)v3, (cocos2d::CCTexture2DPixelFormat)m_loadingBG);
}
}