//
// GameManager::loadDeathEffect from 0x100383170 to 0x100383251 (225 bytes)
//
// 1 xrefs:
// > PlayLayer::setupHasCompleted @ 0x1000adf07
//
// 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::loadDeathEffect(GameManager *a1, int a2)
{
int v2; // eax
int v3; // r12d
int m_loadedDeathEffect; // eax
cocos2d::CCString *v5; // rax
const char *CString; // r14
cocos2d::CCTextureCache *v7; // rax
cocos2d::CCTextureCache *v8; // r15
cocos2d::CCString *v9; // rax
const char *v10; // rax
cocos2d::CCSpriteFrameCache *v11; // r15
cocos2d::CCString *v12; // rax
const char *v13; // rax
char v14; // [rsp+0h] [rbp-20h]
char v15; // [rsp+0h] [rbp-20h]
v2 = 20;
if ( a2 < 20 )
v2 = a2;
v3 = 1;
if ( v2 >= 2 )
v3 = v2;
m_loadedDeathEffect = a1->m_loadedDeathEffect;
if ( v3 != m_loadedDeathEffect )
{
if ( m_loadedDeathEffect >= 2 )
{
v5 = (cocos2d::CCString *)sub_1007AB580("PlayerExplosion_%02d.png", v14);
CString = cocos2d::CCString::getCString(v5);
v7 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v7, CString);
}
if ( a2 >= 2 )
{
v8 = cocos2d::CCTextureCache::sharedTextureCache();
v9 = (cocos2d::CCString *)sub_1007AB580("PlayerExplosion_%02d.png", v14);
v10 = cocos2d::CCString::getCString(v9);
cocos2d::CCTextureCache::addImage(v8, v10, 0);
v11 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v12 = (cocos2d::CCString *)sub_1007AB580("PlayerExplosion_%02d.plist", v15);
v13 = cocos2d::CCString::getCString(v12);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2(v11, v13);
}
a1->m_loadedDeathEffect = v3;
}
}