//
// GameManager::loadGroundAsync from 0x322aa0 to 0x322b40 (160 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::swapGround @ 0x46d206
//
// 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::loadGroundAsync(GameManager *a1, int a2)
{
const char *v3; // r4
cocos2d::CCTexture2DPixelFormat m_loadingG; // r6
_BOOL4 HasSecondaryColor; // r0
_BOOL4 v6; // r7
cocos2d::CCTextureCache *v7; // r8
cocos2d::CCString *v8; // r0
const char *CString; // r0
cocos2d::CCTextureCache *v10; // r7
cocos2d::CCString *v11; // r0
const char *v12; // r0
cocos2d::SEL_MenuHandler v13; // 0:r3.4,4:^0.4
cocos2d::SEL_MenuHandler v14; // 0:r3.4,4:^0.4
if ( a2 <= 0 )
{
v3 = (_BYTE *)(&dword_0 + 1);
}
else
{
if ( a2 >= 22 )
a2 = 22;
v3 = (const char *)a2;
}
m_loadingG = a1->m_loadingG;
if ( !a1->m_loadingG && v3 != (const char *)a1->m_loadedGroundID )
{
a1->m_loadingG = 1;
HasSecondaryColor = GameManager::groundHasSecondaryColor(a1, (int)v3);
a1->m_finishedLoadingG1 = m_loadingG;
a1->m_finishedLoadingG2 = !HasSecondaryColor;
v6 = HasSecondaryColor;
v7 = cocos2d::CCTextureCache::sharedTextureCache();
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"groundSquare_%02d_001.png", v3);
CString = cocos2d::CCString::getCString(v8);
v13.ptr = (void (__cdecl *)(cocos2d::CCObject *))GameManager::finishedLoadingGAsync1;
v13.adj = m_loadingG;
cocos2d::CCTextureCache::addImageAsync(v7, CString, a1, v13, (int)v3, m_loadingG);
if ( v6 )
{
v10 = cocos2d::CCTextureCache::sharedTextureCache();
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"groundSquare_%02d_2_001.png",
v3);
v12 = cocos2d::CCString::getCString(v11);
v14.ptr = (void (__cdecl *)(cocos2d::CCObject *))GameManager::finishedLoadingGAsync2;
v14.adj = m_loadingG;
cocos2d::CCTextureCache::addImageAsync(v10, v12, a1, v14, (int)v3, m_loadingG);
}
}
}