MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / KillSoundLib

Method KillSoundLib

sndlib/hlsoundlib.cpp:554–580  ·  view source on GitHub ↗

Kills the sound library

Source from the content-addressed store, hash-verified

552}
553// Kills the sound library
554void hlsSystem::KillSoundLib(bool f_kill_sound_list) {
555 int i;
556 if (m_f_hls_system_init) {
557 mprintf(1, "m_sounds_played %d\n", m_sounds_played);
558 // clean up stream system
559 AudioStream::Shutdown();
560 for (i = 0; i < MAX_SOUND_OBJECTS; i++) {
561 m_sound_objects[i].m_obj_type_flags = SIF_UNUSED;
562 m_sound_objects[i].m_hlsound_uid = -1;
563 }
564 m_ll_sound_ptr->DestroySoundLib();
565 m_f_hls_system_init = 0;
566 }
567 if (m_ll_sound_ptr) {
568 delete m_ll_sound_ptr;
569 m_ll_sound_ptr = NULL;
570 }
571 // This is independant of the actual sound_lib status. It happened because sounds
572 // use the manage system.
573 // moved this from beginning of function because won't the data freed here screw up streaming/looping sounds?
574 // before the sound library is closed?
575 if (f_kill_sound_list) {
576 for (int i = 0; i < MAX_SOUND_FILES; i++) {
577 SoundLoadFree(i);
578 }
579 }
580}
581// Pause and Resume the library
582// Pauses all sounds
583void hlsSystem::PauseSounds(bool f_all_pause) {

Callers 3

ProcessTestKeysFunction · 0.80
MainLoopFunction · 0.80

Calls 2

SoundLoadFreeFunction · 0.85
DestroySoundLibMethod · 0.80

Tested by

no test coverage detected