Starts a sound playing (if it isn't already)
| 3310 | |
| 3311 | // Starts a sound playing (if it isn't already) |
| 3312 | void TelcomStartSound(int sid) { |
| 3313 | ASSERT(sid >= 0 && sid < TCSND_SOUNDCOUNT); |
| 3314 | |
| 3315 | // make sure the handle is there |
| 3316 | if (TelcomSounds[sid].handle == -1) { |
| 3317 | mprintf(0, "TelCom Sound Warning: '%s' hasn't been loaded yet, trying to load\n", TCSoundFiles[sid]); |
| 3318 | TelcomSounds[sid].handle = FindSoundName(IGNORE_TABLE(TCSoundFiles[sid])); |
| 3319 | |
| 3320 | if (TelcomSounds[sid].handle == -1) { |
| 3321 | mprintf(0, "TelCom Sound Warning: 2nd try failed, bailing\n"); |
| 3322 | return; |
| 3323 | } |
| 3324 | } |
| 3325 | |
| 3326 | // see if the sound is already playing |
| 3327 | if (TelcomSounds[sid].hlhandle != -1) { |
| 3328 | if (Sound_system.IsSoundPlaying(TelcomSounds[sid].hlhandle)) { |
| 3329 | // the sound is still playing, we don't need to play again |
| 3330 | return; |
| 3331 | } |
| 3332 | } |
| 3333 | |
| 3334 | TelcomSounds[sid].hlhandle = Sound_system.Play2dSound(TelcomSounds[sid].handle, MAX_GAME_VOLUME); |
| 3335 | } |
| 3336 | |
| 3337 | // Stops a sound playing |
| 3338 | void TelcomStopSound(int sid) { |
no test coverage detected