- treat 100 as maximum volume for 2D sounds when coming from the SFX data.

Without this, many sounds are way too quiet, e.g. at tne beginning of E2M1 or the end of E3M7.

Fixes #146.
This commit is contained in:
Christoph Oelckers 2020-08-11 20:17:56 +02:00
parent 85364c2bb6
commit fcc271ed7b

View file

@ -170,7 +170,7 @@ void sndStartSample(unsigned int nSound, int nVolume, int nChannel, bool bLoop)
if (nVolume < 0)
{
auto udata = soundEngine->GetUserData(snd);
if (udata) nVolume = udata[2];
if (udata) nVolume = std::min(Scale(udata[2], 255, 100), 255);
else nVolume = 255;
}
soundEngine->StartSound(SOURCE_None, nullptr, nullptr, (nChannel + 1), (bLoop? CHANF_LOOP : EChanFlags::FromInt(0)), snd, nVolume / 255.f, ATTN_NONE);