mirror of https://github.com/axmolengine/axmol.git
parent
683596a023
commit
6d658b341c
|
@ -205,6 +205,7 @@ void SimpleAudioEngine::unloadEffect(int nSoundId)
|
|||
|
||||
delete [] (pElement->pDataBuffer);
|
||||
HASH_DEL(m_pEffects, pElement);
|
||||
free(pElement);
|
||||
} while (0);
|
||||
}
|
||||
|
||||
|
@ -235,6 +236,9 @@ void SimpleAudioEngine::playPreloadedEffect(int nSoundId)
|
|||
{
|
||||
pPlayer = new SoundPlayer();
|
||||
m_EffectPlayers.push_back(pPlayer);
|
||||
|
||||
// set the player volume
|
||||
pPlayer->SetVolumeValue(m_nEffectsVolume);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,9 +252,9 @@ void SimpleAudioEngine::removeAllEffects()
|
|||
{
|
||||
for (tHashElement *pElement = m_pEffects; pElement != NULL; )
|
||||
{
|
||||
unsigned char* pData = pElement->pDataBuffer;
|
||||
delete [] pData;
|
||||
int nSoundID = pElement->nSoundID;
|
||||
pElement = (tHashElement*)pElement->hh.next;
|
||||
unloadEffect(nSoundID);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ Boolean TMainForm::CtrlSelected(TApplication * pApp, EventType * pEvent)
|
|||
|
||||
case TESTAU_ID_Form1002_LoadEffect:
|
||||
// load effect1
|
||||
m_nEffect1ID = pAudioEngine->preloadEffect(/*s_Effect1File*/s_BackgroundFile);
|
||||
m_nEffect1ID = pAudioEngine->preloadEffect(s_Effect1File);
|
||||
assert(m_nEffect1ID > 0);
|
||||
bHandled = TRUE;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue