- moved sound engine cleanup calls to own function

https://forum.zdoom.org/viewtopic.php?t=66605#p1127457
This commit is contained in:
alexey.lysiuk 2019-12-09 16:06:41 +02:00
parent 430a6f3247
commit 5966391108
3 changed files with 16 additions and 6 deletions

View File

@ -742,12 +742,7 @@ void FPlayerSoundHashTable::MarkUsed()
void S_ClearSoundData()
{
if (soundEngine)
{
soundEngine->StopAllChannels();
soundEngine->UnloadAllSounds();
soundEngine->GetSounds().Clear();
soundEngine->ClearRandoms();
}
soundEngine->Clear();
Ambients.Clear();
while (MusicVolumes != NULL)

View File

@ -68,6 +68,20 @@ void SoundEngine::Init(TArray<uint8_t> &curve)
S_SoundCurve = std::move(curve);
}
//==========================================================================
//
// SoundEngine::Clear
//
//==========================================================================
void SoundEngine::Clear()
{
StopAllChannels();
UnloadAllSounds();
GetSounds().Clear();
ClearRandoms();
}
//==========================================================================
//
// S_Shutdown

View File

@ -277,6 +277,7 @@ public:
//
void Init(TArray<uint8_t> &sndcurve);
void InitData();
void Clear();
void Shutdown();
void StopAllChannels(void);