summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorPeterN <peter1138@openttd.org>2021-04-05 11:18:59 +0100
committerGitHub <noreply@github.com>2021-04-05 12:18:59 +0200
commit130a052ed5a364c1b9c4659b44fe2620bdd569e4 (patch)
treec8e6807a63f8625203b5b49c9551de7628465221 /src/sound.cpp
parent1cd3a3b070a9e17acdbe9a875a305643bc834e6a (diff)
downloadopenttd-130a052ed5a364c1b9c4659b44fe2620bdd569e4.tar.xz
Fix: Apply master effect volume during mixing instead of sound start. (#8945)
This makes the volume control work as most players would expect, affecting existing playing sounds as well as new sounds.
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index e6c1cb07c..7d70fa760 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -252,7 +252,7 @@ static void SndPlayScreenCoordFx(SoundID sound, int left, int right, int top, in
StartSound(
sound,
panning,
- (_settings_client.music.effect_vol * _vol_factor_by_zoom[vp->zoom - ZOOM_LVL_BEGIN]) / 256
+ _vol_factor_by_zoom[vp->zoom - ZOOM_LVL_BEGIN]
);
return;
}
@@ -281,7 +281,7 @@ void SndPlayVehicleFx(SoundID sound, const Vehicle *v)
void SndPlayFx(SoundID sound)
{
- StartSound(sound, 0.5, _settings_client.music.effect_vol);
+ StartSound(sound, 0.5, UINT8_MAX);
}
INSTANTIATE_BASE_MEDIA_METHODS(BaseMedia<SoundsSet>, SoundsSet)