Divide sound volume by number of local players

This commit is contained in:
TehRealSalt 2018-10-23 20:53:05 -04:00
parent 2e3f6b09af
commit 5ff1817c34

View file

@ -530,6 +530,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
// Initialize sound parameters
pitch = NORM_PITCH;
priority = NORM_PRIORITY;
volume /= (splitscreen+1);
if (splitscreen && listenmobj2) // Copy the sound for the split player
{
@ -1007,7 +1008,7 @@ void S_UpdateSounds(void)
if (I_SoundIsPlaying(c->handle))
{
// initialize parameters
volume = 255; // 8 bits internal volume precision
volume = 255/(splitscreen+1); // 8 bits internal volume precision
pitch = NORM_PITCH;
sep = NORM_SEP;
@ -1325,6 +1326,8 @@ INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *v
*vol = (15 * ((S_CLIPPING_DIST - approx_dist)>>FRACBITS)) / S_ATTENUATOR;
}
*vol /= (splitscreen+1);
return (*vol > 0);
}