- added a direct native variant for A_PlaySound because this function is relatively easy to test.

This commit is contained in:
Christoph Oelckers 2018-11-25 18:40:26 +01:00
commit 176da5de68
4 changed files with 31 additions and 27 deletions

View file

@ -1443,6 +1443,24 @@ void S_PlaySound(AActor *a, int chan, FSoundID sid, float vol, float atten, bool
}
}
void A_PlaySound(AActor *self, int soundid, int channel, double volume, int looping, double attenuation, int local)
{
if (!looping)
{
if (!(channel & CHAN_NOSTOP) || !S_IsActorPlayingSomething(self, channel & 7, soundid))
{
S_PlaySound(self, channel, soundid, (float)volume, (float)attenuation, local);
}
}
else
{
if (!S_IsActorPlayingSomething(self, channel & 7, soundid))
{
S_PlaySound(self, channel | CHAN_LOOP, soundid, (float)volume, (float)attenuation, local);
}
}
}
//==========================================================================
//
// S_LoadSound