From fcc271ed7bee32114c235433839ead074e5e7d8e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 11 Aug 2020 20:17:56 +0200 Subject: [PATCH] - 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. --- source/blood/src/sound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blood/src/sound.cpp b/source/blood/src/sound.cpp index ea4cc8b46..ffe24b065 100644 --- a/source/blood/src/sound.cpp +++ b/source/blood/src/sound.cpp @@ -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);