mirror of
https://git.code.sf.net/p/quake/nuq
synced 2024-11-21 19:51:09 +00:00
add the beginings of phase interpolation (bloody hell, this is getting
complicated :/, I never guessied it would be this tricy to do phase separated stereo, but I should have :). Without phase interpolation, you get static whenever the phase separation changes due to gaps in the mixed samples.
This commit is contained in:
parent
ff972ff50e
commit
7f1c1bb241
3 changed files with 5 additions and 1 deletions
|
@ -94,7 +94,8 @@
|
|||
#define ch_dist_mult 44
|
||||
#define ch_master_vol 48
|
||||
#define ch_phase 52
|
||||
#define ch_size 56
|
||||
#define ch_phase 56
|
||||
#define ch_size 60
|
||||
|
||||
// portable_samplepair_t structure
|
||||
// !!! if this is changed, it much be changed in sound.h too !!!
|
||||
|
|
|
@ -90,6 +90,7 @@ typedef struct
|
|||
vec_t dist_mult; // distance multiplier (attenuation/clipK)
|
||||
int master_vol; // 0-255 master volume
|
||||
int phase; // phase shift between l-r in samples
|
||||
int oldphase; // phase shift between l-r in samples
|
||||
} channel_t;
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -515,6 +515,7 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
|
|||
target_chan->entnum = entnum;
|
||||
target_chan->entchannel = entchannel;
|
||||
SND_Spatialize(target_chan);
|
||||
target_chan->oldphase = target_chan->phase;
|
||||
|
||||
if (!target_chan->leftvol && !target_chan->rightvol)
|
||||
return; // not audible at all
|
||||
|
@ -686,6 +687,7 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
|
|||
ss->end = paintedtime + sc->length;
|
||||
|
||||
SND_Spatialize (ss);
|
||||
ss->oldphase = ss->phase;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue