| 491 | #define N_MENU_SOUND_SLOTS 4 |
| 492 | |
| 493 | void 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 | } |
no test coverage detected