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

Function PlayMenuSound

Descent3/mmItem.cpp:493–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491#define N_MENU_SOUND_SLOTS 4
492
493void PlayMenuSound(int sound_index, bool wait_till_done) {
494 int sound_uid;
495
496 Sound_system.BeginSoundFrame(false);
497 sound_uid = Sound_system.Play2dSound(sound_index, 1.0f);
498 Sound_system.EndSoundFrame();
499
500 if (wait_till_done) {
501 float timer = timer_GetTime();
502 while (Sound_system.IsSoundPlaying(sound_uid) && ((timer + 5.0f) > timer_GetTime())) {
503 Sound_system.BeginSoundFrame(false);
504 Descent->defer();
505 Sound_system.EndSoundFrame();
506 }
507 }
508}

Callers 2

OnSelectMethod · 0.85
OnGainFocusMethod · 0.85

Calls 5

BeginSoundFrameMethod · 0.80
Play2dSoundMethod · 0.80
EndSoundFrameMethod · 0.80
IsSoundPlayingMethod · 0.45
deferMethod · 0.45

Tested by

no test coverage detected