MCPcopy Create free account
hub / github.com/diasurgical/devilution / PlaySFX_priv

Function PlaySFX_priv

Source/effects.cpp:1035–1066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1033}
1034
1035void 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
1068void stream_play(TSFX *pSFX, int lVolume, int lPan)
1069{

Callers 2

PlaySFXFunction · 0.85
PlaySfxLocFunction · 0.85

Calls 5

snd_playingFunction · 0.85
calc_snd_positionFunction · 0.85
stream_playFunction · 0.85
sound_file_loadFunction · 0.85
snd_play_sndFunction · 0.85

Tested by

no test coverage detected