Skip to content

Commit 9338205

Browse files
committed
Clean snd mix & fix a brain fart.
1 parent 30f7f8c commit 9338205

File tree

2 files changed

+5
-47
lines changed

2 files changed

+5
-47
lines changed

code/client/snd_mix.c

+5-24
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2727
static portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE];
2828
static int snd_vol;
2929

30-
int* snd_p;
30+
int *snd_p;
3131
int snd_linear_count;
32-
short* snd_out;
32+
short *snd_out;
3333

3434
#if !id386 // if configured not to use asm
3535

@@ -378,7 +378,7 @@ static void S_PaintChannelFrom16( channel_t *ch, const sfx_t *sc, int count, int
378378
S_PaintChannelFrom16_scalar( ch, sc, count, sampleOffset, bufferOffset );
379379
}
380380

381-
void S_PaintChannelFromWavelet( channel_t *ch, sfx_t *sc, int count, int sampleOffset, int bufferOffset )
381+
static void S_PaintChannelFromWavelet( channel_t *ch, sfx_t *sc, int count, int sampleOffset, int bufferOffset )
382382
{
383383
int data;
384384
int leftvol, rightvol;
@@ -426,7 +426,7 @@ void S_PaintChannelFromWavelet( channel_t *ch, sfx_t *sc, int count, int sampleO
426426
}
427427
}
428428

429-
void S_PaintChannelFromADPCM( channel_t *ch, sfx_t *sc, int count, int sampleOffset, int bufferOffset )
429+
static void S_PaintChannelFromADPCM( channel_t *ch, sfx_t *sc, int count, int sampleOffset, int bufferOffset )
430430
{
431431
int data;
432432
int leftvol, rightvol;
@@ -479,7 +479,7 @@ void S_PaintChannelFromADPCM( channel_t *ch, sfx_t *sc, int count, int sampleOff
479479
}
480480
}
481481

482-
void S_PaintChannelFromMuLaw( channel_t *ch, sfx_t *sc, int count, int sampleOffset, int bufferOffset )
482+
static void S_PaintChannelFromMuLaw( channel_t *ch, sfx_t *sc, int count, int sampleOffset, int bufferOffset )
483483
{
484484
int data;
485485
int leftvol, rightvol;
@@ -584,8 +584,6 @@ void S_PaintChannels( int endtime )
584584
// clear the paint buffer and mix any raw samples...
585585
Com_Memset(paintbuffer, 0, sizeof (paintbuffer));
586586

587-
#if 1
588-
589587
for (stream = 0; stream < MAX_RAW_STREAMS; stream++)
590588
{
591589
if ( s_rawend[stream] >= s_paintedtime )
@@ -603,23 +601,6 @@ void S_PaintChannels( int endtime )
603601
}
604602
}
605603

606-
#else
607-
608-
if ( s_rawend >= s_paintedtime )
609-
{
610-
// copy from the streaming sound source
611-
const int stop = (end < s_rawend) ? end : s_rawend;
612-
613-
for ( i = s_paintedtime ; i < stop ; i++ )
614-
{
615-
const int s = i&(MAX_RAW_SAMPLES-1);
616-
paintbuffer[i-s_paintedtime].left += s_rawsamples[s].left;
617-
paintbuffer[i-s_paintedtime].right += s_rawsamples[s].right;
618-
}
619-
}
620-
621-
#endif
622-
623604
// paint in the channels.
624605
ch = s_channels;
625606

code/renderer/tr_surface.c

-23
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,10 @@ void RB_AddQuadStampExt( vec3_t origin, vec3_t left, vec3_t up, byte *color, flo
8989
tess.indexes[ tess.numIndexes ] = ndx;
9090
tess.indexes[ tess.numIndexes + 1 ] = ndx + 1;
9191
tess.indexes[ tess.numIndexes + 2 ] = ndx + 3;
92-
9392
tess.indexes[ tess.numIndexes + 3 ] = ndx + 3;
9493
tess.indexes[ tess.numIndexes + 4 ] = ndx + 1;
9594
tess.indexes[ tess.numIndexes + 5 ] = ndx + 2;
9695

97-
#if 0
98-
9996
tess.xyz[ndx][0] = origin[0] + left[0] + up[0];
10097
tess.xyz[ndx][1] = origin[1] + left[1] + up[1];
10198
tess.xyz[ndx][2] = origin[2] + left[2] + up[2];
@@ -111,26 +108,6 @@ void RB_AddQuadStampExt( vec3_t origin, vec3_t left, vec3_t up, byte *color, flo
111108
tess.xyz[ndx+3][0] = origin[0] + left[0] - up[0];
112109
tess.xyz[ndx+3][1] = origin[1] + left[1] - up[1];
113110
tess.xyz[ndx+3][2] = origin[2] + left[2] - up[2];
114-
115-
#else // Cowcat
116-
117-
tess.xyz[ndx][0] = origin[0] + left[0] + up[0];
118-
tess.xyz[ndx][1] = origin[1] + left[1] + up[1];
119-
tess.xyz[ndx][2] = origin[2] + left[2] + up[2];
120-
121-
tess.xyz[ndx+1][0] = origin[0] - left[0] + up[0];
122-
tess.xyz[ndx+1][1] = origin[1] - left[1] + up[1];
123-
tess.xyz[ndx+1][2] = origin[2] - left[2] + up[2];
124-
125-
tess.xyz[ndx+2][0] = tess.xyz[ndx+1][0];
126-
tess.xyz[ndx+2][1] = tess.xyz[ndx+1][1];
127-
tess.xyz[ndx+2][2] = tess.xyz[ndx+1][2];
128-
129-
tess.xyz[ndx+3][0] = tess.xyz[ndx][0];
130-
tess.xyz[ndx+3][1] = tess.xyz[ndx][1];
131-
tess.xyz[ndx+3][2] = tess.xyz[ndx][2];
132-
133-
#endif
134111

135112
// constant normal all the way around
136113
VectorSubtract( vec3_origin, backEnd.viewParms.or.axis[0], normal );

0 commit comments

Comments
 (0)