//
// GameManager::loadGroundAsync from 0x10036cce0 to 0x10036cde0 (256 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::swapGround @ 0x1000f0b8b
//
// This function is hookable on this platform (idp: pc, 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:29:00 +0000
//
__int64 __fastcall GameManager::loadGroundAsync(__int64 a1, int a2)
{
__int64 result; // rax
unsigned int v3; // r14d
__int64 v4; // r15
__int64 v5; // rax
__int64 CString; // rax
__int64 v7; // r15
__int64 v8; // rax
__int64 v9; // rax
char v10; // [rsp+0h] [rbp-30h]
char v11; // [rsp+0h] [rbp-30h]
result = 22;
if ( a2 < 22 )
result = (unsigned int)a2;
v3 = 1;
if ( (int)result >= 2 )
v3 = result;
if ( !*(_BYTE *)(a1 + 1001) && v3 != *(_DWORD *)(a1 + 984) )
{
*(_BYTE *)(a1 + 1001) = 1;
*(_BYTE *)(a1 + 1003) = 0;
*(_BYTE *)(a1 + 1004) = (v3 & 0x7FFFFFFC) != 8;
v4 = cocos2d::CCTextureCache::sharedTextureCache(a1);
v5 = sub_10088E820("groundSquare_%02d_001.png", v10);
CString = cocos2d::CCString::getCString(v5);
result = cocos2d::CCTextureCache::addImageAsync(v4, CString, a1, sub_10036CDE0, 0, v3, 0);
if ( (v3 & 0x7FFFFFFC) == 8 )
{
v7 = cocos2d::CCTextureCache::sharedTextureCache(v4);
v8 = sub_10088E820("groundSquare_%02d_2_001.png", v11);
v9 = cocos2d::CCString::getCString(v8);
return cocos2d::CCTextureCache::addImageAsync(v7, v9, a1, GameManager::finishedLoadingGAsync2, 0, v3, 0);
}
}
return result;
}