//
// GameManager::loadGroundAsync from 0x414a48 to 0x414ae8 (160 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::swapGround @ 0x58bda2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:47:39 +0000
//
int __fastcall GameManager::loadGroundAsync(int this, const char *a2)
{
int v2; // r5
const char *v3; // r4
int v4; // r6
_BOOL4 HasSecondaryColor; // r0
_BOOL4 v6; // r7
int v7; // r8
cocos2d::CCString *v8; // r0
char *CString; // r0
int v10; // r7
cocos2d::CCString *v11; // r0
char *v12; // r0
v2 = this;
if ( (int)a2 <= 0 )
{
v3 = (_BYTE *)(&dword_0 + 1);
}
else
{
if ( (int)a2 >= 22 )
a2 = (_BYTE *)(&dword_14 + 2);
v3 = a2;
}
v4 = *(unsigned __int8 *)(this + 789);
if ( !*(_BYTE *)(this + 789) && v3 != *(const char **)(this + 772) )
{
*(_BYTE *)(this + 789) = 1;
HasSecondaryColor = GameManager::groundHasSecondaryColor((GameManager *)this, (int)v3);
*(_BYTE *)(v2 + 791) = v4;
*(_BYTE *)(v2 + 792) = !HasSecondaryColor;
v6 = HasSecondaryColor;
v7 = cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)HasSecondaryColor);
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"groundSquare_%02d_001.png", v3);
CString = (char *)cocos2d::CCString::getCString(v8);
this = cocos2d::CCTextureCache::addImageAsync(
v7,
CString,
v2,
(int)GameManager::finishedLoadingGAsync1,
v4,
(int)v3,
v4);
if ( v6 )
{
v10 = cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)this);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"groundSquare_%02d_2_001.png",
v3);
v12 = (char *)cocos2d::CCString::getCString(v11);
return cocos2d::CCTextureCache::addImageAsync(
v10,
v12,
v2,
(int)GameManager::finishedLoadingGAsync2,
v4,
(int)v3,
v4);
}
}
return this;
}