#endif
// LordHavoc: was 512, expanded to 2048
-#define PAINTBUFFER_SIZE 2048
+#define PAINTBUFFER_SIZE 2048
portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE];
-int snd_scaletable[32][256];
+int snd_scaletable[32][256];
/*
// LordHavoc: disabled this because it desyncs with the video too easily
void S_PaintChannels(int endtime)
{
- int i;
- int end;
+ int i;
+ int end;
channel_t *ch;
- sfxcache_t *sc;
- int ltime, count;
+ sfxcache_t *sc;
+ int ltime, count;
while (paintedtime < endtime)
{
if (endtime - paintedtime > PAINTBUFFER_SIZE)
end = paintedtime + PAINTBUFFER_SIZE;
- // clear the paint buffer
- memset(paintbuffer, 0, (end - paintedtime) * sizeof(portable_samplepair_t));
+ // clear the paint buffer, filling it with data from rawsamples (music/video/whatever)
+ S_RawSamples_Dequeue(&paintbuffer->left, end - paintedtime);
// paint in the channels.
ch = channels;
}
}
}
-
}
// transfer out according to DMA format
void SND_InitScaletable (void)
{
- int i, j;
+ int i, j;
- for (i=0 ; i<32 ; i++)
- for (j=0 ; j<256 ; j++)
+ for (i = 0;i < 32;i++)
+ for (j = 0;j < 256;j++)
snd_scaletable[i][j] = ((signed char)j) * i * 8;
}
void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count)
{
- int *lscale, *rscale;
+ int *lscale, *rscale;
unsigned char *sfx;
- int i;
+ int i;
if (ch->leftvol > 255)
ch->leftvol = 255;
{
int leftvol, rightvol;
signed short *sfx;
- int i;
+ int i;
leftvol = ch->leftvol;
rightvol = ch->rightvol;