//
// LevelSettingsLayer::selectArtClosed from 0x6a8b9c to 0x6a8cfc (352 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'LevelSettingsLayer::selectArtClosed @ 0x6a8d0c
//
// 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:56:32 +0000
//
float __fastcall LevelSettingsLayer::selectArtClosed(float this, SelectArtLayer *a2)
{
float v2; // r4
int v3; // r3
GJBaseGameLayer *v5; // r0
int v6; // r0
cocos2d::CCSpriteFrameCache *Background; // r0
int v8; // r6
void (__fastcall *v9)(int, int); // r7
cocos2d::CCSpriteFrameCache *v10; // r8
cocos2d::CCString *v11; // r0
const char *v12; // r0
int v13; // r0
GJBaseGameLayer *v14; // r0
_DWORD *v15; // r0
cocos2d::CCSpriteFrameCache *Ground; // r0
int v17; // r6
void (__fastcall *v18)(int, int); // r7
cocos2d::CCSpriteFrameCache *v19; // r8
cocos2d::CCString *v20; // r0
const char *CString; // r0
int v22; // r0
GJBaseGameLayer *v23; // r0
const char **v24; // r0
const char **Middleground; // r0
int v26; // r6
void (__fastcall *v27)(int, int); // r7
cocos2d::CCSpriteFrameCache *v28; // r8
cocos2d::CCString *v29; // r0
const char *v30; // r0
int v31; // r0
v2 = this;
v3 = *((_DWORD *)a2 + 134);
if ( v3 )
{
if ( v3 == 1 )
{
v14 = *(GJBaseGameLayer **)(LODWORD(this) + 616);
if ( v14 )
v14 = (GJBaseGameLayer *)GJBaseGameLayer::removeGroundLayer(v14);
*(_DWORD *)(*(_DWORD *)(LODWORD(v2) + 596) + 296) = *((_DWORD *)a2 + 132);
*(_DWORD *)(*(_DWORD *)(LODWORD(v2) + 596) + 344) = *((_DWORD *)a2 + 133);
v15 = (_DWORD *)GameManager::sharedState(v14);
Ground = (cocos2d::CCSpriteFrameCache *)GameManager::loadGround(v15, *((const char **)a2 + 132));
v17 = *(_DWORD *)(LODWORD(v2) + 580);
v18 = *(void (__fastcall **)(int, int))(*(_DWORD *)v17 + 580);
v19 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(Ground);
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"gIcon_%02d_001.png",
*((const char **)a2 + 132));
CString = (const char *)cocos2d::CCString::getCString(v20);
v22 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v19, CString);
v18(v17, v22);
this = *(float *)(LODWORD(v2) + 616);
if ( this != 0.0 )
return COERCE_FLOAT(
GJBaseGameLayer::createGroundLayer(
(GJBaseGameLayer *)LODWORD(this),
*(GJGroundLayer **)(*(_DWORD *)(LODWORD(v2) + 596) + 296),
*(_DWORD *)(*(_DWORD *)(LODWORD(v2) + 596) + 344)));
}
else if ( v3 == 2 )
{
v23 = *(GJBaseGameLayer **)(LODWORD(this) + 616);
if ( v23 )
v23 = (GJBaseGameLayer *)GJBaseGameLayer::removeMiddleground(v23);
*(_DWORD *)(*(_DWORD *)(LODWORD(v2) + 596) + 304) = *((_DWORD *)a2 + 132);
v24 = (const char **)GameManager::sharedState(v23);
Middleground = GameManager::loadMiddleground(v24, *((_DWORD *)a2 + 132));
v26 = *(_DWORD *)(LODWORD(v2) + 584);
v27 = *(void (__fastcall **)(int, int))(*(_DWORD *)v26 + 580);
v28 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache((cocos2d::CCSpriteFrameCache *)Middleground);
v29 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"mgIcon_%02d_001.png",
*((const char **)a2 + 132));
v30 = (const char *)cocos2d::CCString::getCString(v29);
v31 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v28, v30);
v27(v26, v31);
this = *(float *)(LODWORD(v2) + 616);
if ( this != 0.0 )
return COERCE_FLOAT(
GJBaseGameLayer::createMiddleground(
(GJBaseGameLayer *)LODWORD(this),
*(GJMGLayer **)(*(_DWORD *)(LODWORD(v2) + 596) + 304)));
}
}
else
{
v5 = *(GJBaseGameLayer **)(LODWORD(this) + 616);
if ( v5 )
v5 = (GJBaseGameLayer *)GJBaseGameLayer::removeBackground(v5);
*(_DWORD *)(*(_DWORD *)(LODWORD(v2) + 596) + 292) = *((_DWORD *)a2 + 132);
v6 = GameManager::sharedState(v5);
Background = (cocos2d::CCSpriteFrameCache *)GameManager::loadBackground(v6, *((const char **)a2 + 132));
v8 = *(_DWORD *)(LODWORD(v2) + 576);
v9 = *(void (__fastcall **)(int, int))(*(_DWORD *)v8 + 580);
v10 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(Background);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"bgIcon_%02d_001.png",
*((const char **)a2 + 132));
v12 = (const char *)cocos2d::CCString::getCString(v11);
v13 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v10, v12);
v9(v8, v13);
this = *(float *)(LODWORD(v2) + 616);
if ( this != 0.0 )
return GJBaseGameLayer::createBackground(
(GJBaseGameLayer *)LODWORD(this),
*(const char **)(*(_DWORD *)(LODWORD(v2) + 596) + 292));
}
return this;
}