//
// GameManager::loadGround from 0x100318938 to 0x100318a4c (276 bytes)
//
// 2 xrefs:
// > LevelSettingsLayer::selectArtClosed @ 0x10017c204
// > GameManager::getGTexture @ 0x100318d48
//
// 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 __fastcall GameManager::loadGround(GameManager *a1, int a2)
{
int v2; // w8
int v3; // w21
int m_loadedGroundID; // w8
cocos2d::CCString *v6; // x0
const char *CString; // x20
cocos2d::CCTextureCache *v8; // x0
cocos2d::CCTextureCache *v9; // x20
cocos2d::CCString *v10; // x0
const char *v11; // x0
cocos2d::CCString *v12; // x0
const char *v13; // x20
cocos2d::CCTextureCache *v14; // x0
cocos2d::CCTextureCache *v15; // x20
cocos2d::CCString *v16; // x0
const char *v17; // x0
if ( a2 >= 22 )
v2 = 22;
else
v2 = a2;
if ( v2 <= 1 )
v3 = 1;
else
v3 = v2;
m_loadedGroundID = a1->m_loadedGroundID;
if ( v3 != m_loadedGroundID )
{
if ( m_loadedGroundID )
{
v6 = (cocos2d::CCString *)sub_100268F4C("groundSquare_%02d_001.png", a1->m_loadedGroundID);
CString = cocos2d::CCString::getCString(v6);
v8 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v8, CString);
if ( (a1->m_loadedGroundID & 0xFFFFFFFC) == 8 )
{
v9 = cocos2d::CCTextureCache::sharedTextureCache();
v10 = (cocos2d::CCString *)sub_100268F4C("groundSquare_%02d_2_001.png", a1->m_loadedGroundID);
v11 = cocos2d::CCString::getCString(v10);
cocos2d::CCTextureCache::removeTextureForKey(v9, v11);
}
}
v12 = (cocos2d::CCString *)sub_100268F4C("groundSquare_%02d_001.png", v3);
v13 = cocos2d::CCString::getCString(v12);
v14 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v14, v13, 0);
if ( (v3 & 0x7FFFFFFC) == 8 )
{
v15 = cocos2d::CCTextureCache::sharedTextureCache();
v16 = (cocos2d::CCString *)sub_100268F4C("groundSquare_%02d_2_001.png", v3);
v17 = cocos2d::CCString::getCString(v16);
cocos2d::CCTextureCache::addImage(v15, v17, 0);
}
a1->m_loadedGroundID = v3;
}
}