//
// GameManager::loadDeathEffect from 0x5ebc9c to 0x5ebd78 (220 bytes)
//
// 2 xrefs:
// > PlayLayer::setupHasCompleted @ 0x5dc400
// > ??> @ 0x75f78
//
// 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 v2; // w19
int m_loadedDeathEffect; // w1
cocos2d::CCString *v5; // x0
cocos2d::CCTextureCache *v6; // x0
cocos2d::CCTextureCache *v7; // x22
cocos2d::CCString *v8; // x0
const char *v9; // x0
cocos2d::CCSpriteFrameCache *v10; // x22
cocos2d::CCString *v11; // x0
const char *v12; // x0
char *CString; // [xsp+38h] [xbp+38h]
if ( a2 <= 0 )
{
v2 = 1;
}
else if ( a2 > 20 )
{
v2 = 20;
}
else
{
v2 = a2;
}
m_loadedDeathEffect = a1->m_loadedDeathEffect;
if ( v2 != m_loadedDeathEffect )
{
if ( m_loadedDeathEffect > 1 )
{
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"PlayerExplosion_%02d.png",
(const char *)(unsigned int)(m_loadedDeathEffect - 1));
CString = (char *)cocos2d::CCString::getCString(v5);
v6 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v6, CString);
}
if ( v2 > 1 )
{
v7 = cocos2d::CCTextureCache::sharedTextureCache();
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"PlayerExplosion_%02d.png",
(const char *)(unsigned int)(v2 - 1));
v9 = cocos2d::CCString::getCString(v8);
cocos2d::CCTextureCache::addImage(v7, v9, 0);
v10 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"PlayerExplosion_%02d.plist",
(const char *)(unsigned int)(v2 - 1));
v12 = cocos2d::CCString::getCString(v11);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v10, v12);
}
a1->m_loadedDeathEffect = v2;
}
}