mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-15 09:11:59 +00:00
Merge branch 'div-sounds' into 'master'
Divide sound with number of local players See merge request KartKrew/Kart!66
This commit is contained in:
commit
8dbb636b2f
1 changed files with 9 additions and 0 deletions
|
@ -531,6 +531,9 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
|
|||
pitch = NORM_PITCH;
|
||||
priority = NORM_PRIORITY;
|
||||
|
||||
if (splitscreen && origin)
|
||||
volume = FixedDiv(volume<<FRACBITS, FixedSqrt((splitscreen+1)<<FRACBITS))>>FRACBITS;
|
||||
|
||||
if (splitscreen && listenmobj2) // Copy the sound for the split player
|
||||
{
|
||||
// Check to see if it is audible, and if not, modify the params
|
||||
|
@ -1011,6 +1014,9 @@ void S_UpdateSounds(void)
|
|||
pitch = NORM_PITCH;
|
||||
sep = NORM_SEP;
|
||||
|
||||
if (splitscreen && c->origin)
|
||||
volume = FixedDiv(volume<<FRACBITS, FixedSqrt((splitscreen+1)<<FRACBITS))>>FRACBITS;
|
||||
|
||||
// check non-local sounds for distance clipping
|
||||
// or modify their params
|
||||
if (c->origin && ((c->origin != players[consoleplayer].mo)
|
||||
|
@ -1325,6 +1331,9 @@ INT32 S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *v
|
|||
*vol = (15 * ((S_CLIPPING_DIST - approx_dist)>>FRACBITS)) / S_ATTENUATOR;
|
||||
}
|
||||
|
||||
if (splitscreen)
|
||||
*vol = FixedDiv((*vol)<<FRACBITS, FixedSqrt((splitscreen+1)<<FRACBITS))>>FRACBITS;
|
||||
|
||||
return (*vol > 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue