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.
This commit is contained in:
PeterN
2021-04-05 11:18:59 +01:00
committed by GitHub
parent 1cd3a3b070
commit 130a052ed5
2 changed files with 13 additions and 10 deletions

View File

@@ -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)