| 1033 | } |
| 1034 | |
| 1035 | void PlaySFX_priv(TSFX *pSFX, BOOL loc, int x, int y) |
| 1036 | { |
| 1037 | int lPan, lVolume; |
| 1038 | |
| 1039 | if (plr[myplr].pLvlLoad && gbMaxPlayers != 1) { |
| 1040 | return; |
| 1041 | } |
| 1042 | if (!gbSndInited || !gbSoundOn || gbBufferMsgs) { |
| 1043 | return; |
| 1044 | } |
| 1045 | |
| 1046 | if (!(pSFX->bFlags & (SFX_STREAM | SFX_MISC)) && pSFX->pSnd != 0 && snd_playing(pSFX->pSnd)) { |
| 1047 | return; |
| 1048 | } |
| 1049 | |
| 1050 | lPan = 0; |
| 1051 | lVolume = 0; |
| 1052 | if (loc && !calc_snd_position(x, y, &lVolume, &lPan)) { |
| 1053 | return; |
| 1054 | } |
| 1055 | |
| 1056 | if (pSFX->bFlags & SFX_STREAM) { |
| 1057 | stream_play(pSFX, lVolume, lPan); |
| 1058 | return; |
| 1059 | } |
| 1060 | |
| 1061 | if (!pSFX->pSnd) |
| 1062 | pSFX->pSnd = sound_file_load(pSFX->pszName); |
| 1063 | |
| 1064 | if (pSFX->pSnd) |
| 1065 | snd_play_snd(pSFX->pSnd, lVolume, lPan); |
| 1066 | } |
| 1067 | |
| 1068 | void stream_play(TSFX *pSFX, int lVolume, int lPan) |
| 1069 | { |
no test coverage detected