- Blood: unpositioned sounds must be limited to one per channel.

This commit is contained in:
Christoph Oelckers 2021-05-16 11:51:51 +02:00
parent 98ca5d5db4
commit 60fe1d32fb
3 changed files with 6 additions and 10 deletions

View File

@ -929,12 +929,7 @@ void SoundEngine::StopSound(int sourcetype, const void* actor, int channel, int
void SoundEngine::StopActorSounds(int sourcetype, const void* actor, int chanmin, int chanmax)
{
const bool all = (chanmin == 0 && chanmax == 0);
if (!all && chanmax > chanmin)
{
const int temp = chanmax;
chanmax = chanmin;
chanmin = temp;
}
if (chanmax < chanmin) std::swap(chanmin, chanmax);
FSoundChan* chan = Channels;
while (chan != nullptr)

View File

@ -1192,10 +1192,10 @@ void S_SetSoundPaused(int state)
if (paused == 0)
{
S_ResumeSound(true);
if (GSnd != nullptr)
{
GSnd->SetInactive(SoundRenderer::INACTIVE_Active);
}
}
if (GSnd != nullptr)
{
GSnd->SetInactive(SoundRenderer::INACTIVE_Active);
}
}
else

View File

@ -181,6 +181,7 @@ void sndStartSample(unsigned int nSound, int nVolume, int nChannel, bool bLoop,
else nVolume = 255;
}
if (bLoop) chanflags |= CHANF_LOOP;
soundEngine->StopActorSounds(SOURCE_None, nullptr, nChannel + 1, nChannel + 1);
soundEngine->StartSound(SOURCE_None, nullptr, nullptr, (nChannel + 1), chanflags, snd, nVolume / 255.f, ATTN_NONE);
}
}