aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/snd_mix.c
diff options
context:
space:
mode:
authoricculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-06-01 07:51:23 +0000
committericculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-06-01 07:51:23 +0000
commit10afaeef337e0d19b37cb7dbe3fccee48bf18a43 (patch)
tree365da78a39bf90a8321da9f9bbf554ff5733eae6 /code/client/snd_mix.c
parent94017ca419caff91bf26841b503b5867d992ca4c (diff)
downloadioquake3-aero-10afaeef337e0d19b37cb7dbe3fccee48bf18a43.tar.gz
ioquake3-aero-10afaeef337e0d19b37cb7dbe3fccee48bf18a43.zip
Initial patch for in-game VoIP support!
git-svn-id: svn://svn.icculus.org/quake3/trunk@1348 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client/snd_mix.c')
-rw-r--r--code/client/snd_mix.c38
1 files changed, 13 insertions, 25 deletions
diff --git a/code/client/snd_mix.c b/code/client/snd_mix.c
index 62e6841..cf0a999 100644
--- a/code/client/snd_mix.c
+++ b/code/client/snd_mix.c
@@ -631,12 +631,12 @@ S_PaintChannels
void S_PaintChannels( int endtime ) {
int i;
int end;
+ int stream;
channel_t *ch;
sfx_t *sc;
int ltime, count;
int sampleOffset;
-
snd_vol = s_volume->value*255;
//Com_Printf ("%i to %i\n", s_paintedtime, endtime);
@@ -648,30 +648,18 @@ void S_PaintChannels( int endtime ) {
end = s_paintedtime + PAINTBUFFER_SIZE;
}
- // clear the paint buffer to either music or zeros
- if ( s_rawend < s_paintedtime ) {
- if ( s_rawend ) {
- //Com_DPrintf ("background sound underrun\n");
- }
- Com_Memset(paintbuffer, 0, (end - s_paintedtime) * sizeof(portable_samplepair_t));
- } else {
- // copy from the streaming sound source
- int s;
- int stop;
-
- stop = (end < s_rawend) ? end : s_rawend;
-
- for ( i = s_paintedtime ; i < stop ; i++ ) {
- s = i&(MAX_RAW_SAMPLES-1);
- paintbuffer[i-s_paintedtime] = s_rawsamples[s];
- }
-// if (i != end)
-// Com_Printf ("partial stream\n");
-// else
-// Com_Printf ("full stream\n");
- for ( ; i < end ; i++ ) {
- paintbuffer[i-s_paintedtime].left =
- paintbuffer[i-s_paintedtime].right = 0;
+ // clear the paint buffer and mix any raw samples...
+ Com_Memset(paintbuffer, 0, sizeof (paintbuffer));
+ for (stream = 0; stream < MAX_RAW_STREAMS; stream++) {
+ if ( s_rawend[stream] >= s_paintedtime ) {
+ // copy from the streaming sound source
+ const portable_samplepair_t *rawsamples = s_rawsamples[stream];
+ const int stop = (end < s_rawend[stream]) ? end : s_rawend[stream];
+ for ( i = s_paintedtime ; i < stop ; i++ ) {
+ const int s = i&(MAX_RAW_SAMPLES-1);
+ paintbuffer[i-s_paintedtime].left += rawsamples[s].left;
+ paintbuffer[i-s_paintedtime].right += rawsamples[s].right;
+ }
}
}