//
// GameManager::loadDeathEffect from 0x322654 to 0x3226d4 (128 bytes)
//
// 1 xrefs:
// > PlayLayer::setupHasCompleted @ 0x31bc80
//
// 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 GameManager::loadDeathEffect(GameManager *a1, int a2)
{
int v3; // r4
int m_loadedDeathEffect; // r1
cocos2d::CCString *v5; // r0
const char *CString; // r5
cocos2d::CCTextureCache *v7; // r0
cocos2d::CCTextureCache *v8; // r7
cocos2d::CCString *v9; // r0
const char *v10; // r0
cocos2d::CCSpriteFrameCache *v11; // r7
cocos2d::CCString *v12; // r0
const char *v13; // r0
if ( a2 <= 0 )
{
v3 = 1;
}
else
{
if ( a2 >= 20 )
a2 = 20;
v3 = a2;
}
m_loadedDeathEffect = a1->m_loadedDeathEffect;
if ( v3 != m_loadedDeathEffect )
{
if ( m_loadedDeathEffect > 1 )
{
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"PlayerExplosion_%02d.png",
(const char *)(m_loadedDeathEffect - 1));
CString = cocos2d::CCString::getCString(v5);
v7 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v7, CString);
}
if ( v3 > 1 )
{
v8 = cocos2d::CCTextureCache::sharedTextureCache();
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"PlayerExplosion_%02d.png",
(const char *)(v3 - 1));
v10 = cocos2d::CCString::getCString(v9);
cocos2d::CCTextureCache::addImage(v8, v10, 0);
v11 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"PlayerExplosion_%02d.plist",
(const char *)(v3 - 1));
v13 = cocos2d::CCString::getCString(v12);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v11, v13);
}
a1->m_loadedDeathEffect = v3;
}
}