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

Function stream_play

Source/effects.cpp:1068–1089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1066}
1067
1068void stream_play(TSFX *pSFX, int lVolume, int lPan)
1069{
1070 BOOL success;
1071
1072 /// ASSERT: assert(pSFX);
1073 /// ASSERT: assert(pSFX->bFlags & sfx_STREAM);
1074 sfx_stop();
1075 lVolume += sound_get_or_set_sound_volume(1);
1076 if (lVolume >= VOLUME_MIN) {
1077 if (lVolume > VOLUME_MAX)
1078 lVolume = VOLUME_MAX;
1079 success = SFileOpenFile(pSFX->pszName, &sfx_stream);
1080 if (!success) {
1081 sfx_stream = 0;
1082 } else {
1083 if (!SFileDdaBeginEx(sfx_stream, 0x40000, 0, 0, lVolume, lPan, 0))
1084 sfx_stop();
1085 else
1086 sfx_data_cur = pSFX;
1087 }
1088 }
1089}
1090
1091int RndSFX(int psfx)
1092{

Callers 1

PlaySFX_privFunction · 0.85

Calls 4

sfx_stopFunction · 0.85
SFileOpenFileFunction · 0.85
SFileDdaBeginExFunction · 0.85

Tested by

no test coverage detected