From 920f42418444cc5b2db5f39043546af32400fd29 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 24 Feb 2020 18:34:15 +0100 Subject: [PATCH] - pitch fix. --- source/exhumed/src/sound.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/exhumed/src/sound.cpp b/source/exhumed/src/sound.cpp index 666b20531..20efa4598 100644 --- a/source/exhumed/src/sound.cpp +++ b/source/exhumed/src/sound.cpp @@ -540,7 +540,7 @@ void UpdateSounds() if (!(chan->ChanFlags & (CHANF_UI|CHANF_FORGETTABLE))) { int nVolume = 255; - int nPitch = int(chan->Pitch * (128.f * 11025.f)) - 11025; + int nPitch = int(chan->Pitch * (11025.f / 128.f)) - 11025; GetSpriteSoundPitch(&nVolume, &nPitch); soundEngine->SetPitch(chan, (11025 + nPitch) / 11025.f); soundEngine->SetVolume(chan, nVolume / 255.f); @@ -597,7 +597,7 @@ void PlayFX2(unsigned short nSound, short nSprite) if (nSprite) { - soundEngine->StartSound(SOURCE_Actor, &sprite[nSprite], nullptr, CHAN_BODY, CHANF_NONE, nSound+1, nVolume / 255.f, ATTN_NORM, nullptr, (11025 + nPitch) / 11025.f); + soundEngine->StartSound(SOURCE_Actor, &sprite[nSprite], nullptr, CHAN_BODY, CHANF_OVERLAP, nSound+1, nVolume / 255.f, ATTN_NORM, nullptr, (11025 + nPitch) / 11025.f); } else {