//
// GameManager::loadGroundAsync from 0x716d7c to 0x716e84 (264 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::swapGround @ 0x99978c
// > ??> @ 0xddc68
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:52:16 +0000
//
__int64 __fastcall GameManager::loadGroundAsync(__int64 this, int a2)
{
unsigned int v2; // w19
__int64 v3; // x20
_BOOL4 HasSecondaryColor; // w21
int v5; // w22
cocos2d::CCString *v6; // x0
char *CString; // x0
int v8; // w21
cocos2d::CCString *v9; // x0
char *v10; // x0
if ( a2 <= 0 )
{
v2 = 1;
}
else if ( a2 > 22 )
{
v2 = 22;
}
else
{
v2 = a2;
}
if ( !*(_BYTE *)(this + 1001) && v2 != *(_DWORD *)(this + 984) )
{
v3 = this;
*(_BYTE *)(this + 1001) = 1;
HasSecondaryColor = GameManager::groundHasSecondaryColor((GameManager *)this, v2);
*(_BYTE *)(v3 + 1003) = 0;
*(_BYTE *)(v3 + 1004) = !HasSecondaryColor;
v5 = cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)!HasSecondaryColor);
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"groundSquare_%02d_001.png",
(const char *)v2);
CString = (char *)cocos2d::CCString::getCString(v6);
this = cocos2d::CCTextureCache::addImageAsync(v5, CString);
if ( HasSecondaryColor )
{
v8 = cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)this);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"groundSquare_%02d_2_001.png",
(const char *)v2);
v10 = (char *)cocos2d::CCString::getCString(v9);
return cocos2d::CCTextureCache::addImageAsync(v8, v10);
}
}
return this;
}