//
// GameManager::loadGround from 0x10036cbc0 to 0x10036ccd9 (281 bytes)
//
// 2 xrefs:
// > LevelSettingsLayer::selectArtClosed @ 0x10025949b
// > GameManager::getGTexture @ 0x10036cfc0
//
// 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::loadGround(__int64 a1, int a2)
{
char v2; // al
__int64 result; // rax
int v4; // r14d
int v5; // esi
__int64 v7; // rdi
__int64 CString; // r15
__int64 v9; // rdi
__int64 v10; // r15
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rdi
__int64 v14; // r15
__int64 v15; // rdi
__int64 v16; // r15
__int64 v17; // rax
__int64 v18; // rax
char v19; // [rsp-8h] [rbp-20h]
char v20; // [rsp-8h] [rbp-20h]
v19 = v2;
result = 22;
if ( a2 < 22 )
result = (unsigned int)a2;
v4 = 1;
if ( (int)result >= 2 )
v4 = result;
v5 = *(_DWORD *)(a1 + 984);
if ( v4 != v5 )
{
if ( v5 )
{
v7 = sub_10088E820("groundSquare_%02d_001.png", v19);
CString = cocos2d::CCString::getCString(v7);
v9 = cocos2d::CCTextureCache::sharedTextureCache(v7);
cocos2d::CCTextureCache::removeTextureForKey(v9, CString);
if ( (*(_DWORD *)(a1 + 984) & 0xFFFFFFFC) == 8 )
{
v10 = cocos2d::CCTextureCache::sharedTextureCache(v9);
v11 = sub_10088E820("groundSquare_%02d_2_001.png", v19);
v12 = cocos2d::CCString::getCString(v11);
cocos2d::CCTextureCache::removeTextureForKey(v10, v12);
}
}
v13 = sub_10088E820("groundSquare_%02d_001.png", v19);
v14 = cocos2d::CCString::getCString(v13);
v15 = cocos2d::CCTextureCache::sharedTextureCache(v13);
cocos2d::CCTextureCache::addImage(v15, v14, 0);
result = v4 & 0x7FFFFFFC;
if ( (_DWORD)result == 8 )
{
v16 = cocos2d::CCTextureCache::sharedTextureCache(v15);
v17 = sub_10088E820("groundSquare_%02d_2_001.png", v20);
v18 = cocos2d::CCString::getCString(v17);
result = cocos2d::CCTextureCache::addImage(v16, v18, 0);
}
*(_DWORD *)(a1 + 984) = v4;
}
return result;
}