Go to the source code of this file.
|
static void | WriteLinearBlast (int16_t *out, samplepair_t *samp, int count) |
|
static void | TransferStereo16 (samplepair_t *samp, int endtime) |
|
static void | TransferStereo (samplepair_t *samp, int endtime) |
|
static void | TransferPaintBuffer (samplepair_t *samp, int endtime) |
|
static void | Paint8 (channel_t *ch, sfxcache_t *sc, int count, samplepair_t *samp) |
|
static void | Paint16 (channel_t *ch, sfxcache_t *sc, int count, samplepair_t *samp) |
|
void | S_PaintChannels (int endtime) |
|
void | S_InitScaletable (void) |
|
void | S_RawSamples (int samples, int rate, int width, int channels, byte *data, float volume) |
|
void | S_UnqueueRawSamples () |
|
◆ PAINTBUFFER_SIZE
#define PAINTBUFFER_SIZE 2048 |
Definition at line 22 of file mix.c.
◆ Paint16()
Definition at line 156 of file mix.c.
160 int leftvol, rightvol;
166 sfx = (int16_t *)sc->
data + ch->
pos;
168 for (i = 0; i <
count; i++, samp++) {
170 left = (data * leftvol) >> 8;
171 right = (data * rightvol) >> 8;
Referenced by S_PaintChannels().
◆ Paint8()
Definition at line 131 of file mix.c.
134 int *lscale, *rscale;
145 sfx = (uint8_t *)sc->
data + ch->
pos;
147 for (i = 0; i <
count; i++, samp++) {
149 samp->
left += lscale[data];
150 samp->
right += rscale[data];
Referenced by S_PaintChannels().
◆ S_InitScaletable()
Definition at line 281 of file mix.c.
287 for (i = 0; i < 32; i++) {
289 for (j = 0; j < 256; j++) {
Referenced by DMA_Init(), and S_Update().
◆ S_PaintChannels()
void S_PaintChannels |
( |
int |
endtime | ) |
|
Definition at line 179 of file mix.c.
218 while (ltime < end) {
244 if (ltime >= ch->
end) {
Referenced by DMA_Update().
◆ S_RawSamples()
void S_RawSamples |
( |
int |
samples, |
|
|
int |
rate, |
|
|
int |
width, |
|
|
int |
channels, |
|
|
byte * |
data, |
|
|
float |
volume |
|
) |
| |
Definition at line 303 of file mix.c.
321 float scale = (float)rate /
dma.speed;
322 int intVolume = (
int)(256 *
volume);
326 for (
int i = 0; ; i++)
328 int src = (
int)(i * scale);
343 for (
int i = 0; ; i++)
345 int src = (
int)(i * scale);
362 for (
int i = 0; ; i++)
364 int src = (
int)(i * scale);
374 (((
byte *)data)[src * 2] - 128) * intVolume;
376 (((
byte *)data)[src * 2 + 1] - 128) * intVolume;
383 for (
int i = 0; ; i++)
385 int src = (
int)(i * scale);
Referenced by OGG_Read(), and SCR_ReadNextFrame().
◆ S_UnqueueRawSamples()
void S_UnqueueRawSamples |
( |
| ) |
|
◆ TransferPaintBuffer()
◆ TransferStereo()
Definition at line 68 of file mix.c.
70 int out_idx, out_mask;
77 out_mask =
dma.samples - 1;
79 step = 3 -
dma.channels;
81 if (
dma.samplebits == 16) {
82 int16_t *out = (int16_t *)
dma.buffer;
86 clamp(val, INT16_MIN, INT16_MAX);
88 out_idx = (out_idx + 1) & out_mask;
90 }
else if (
dma.samplebits == 8) {
91 uint8_t *out = (uint8_t *)
dma.buffer;
95 clamp(val, INT16_MIN, INT16_MAX);
96 out[out_idx] = (val >> 8) + 128;
97 out_idx = (out_idx + 1) & out_mask;
Referenced by TransferPaintBuffer().
◆ TransferStereo16()
Definition at line 43 of file mix.c.
52 lpos = ltime & ((
dma.samples >> 1) - 1);
54 out = (int16_t *)
dma.buffer + (lpos << 1);
57 if (ltime +
count > endtime)
58 count = endtime - ltime;
Referenced by TransferPaintBuffer().
◆ WriteLinearBlast()
Definition at line 30 of file mix.c.
34 for (i = 0; i <
count; i++, samp++, out += 2) {
35 val = samp->left >> 8;
36 out[0] = clamp(val, INT16_MIN, INT16_MAX);
38 val = samp->right >> 8;
39 out[1] = clamp(val, INT16_MIN, INT16_MAX);
Referenced by TransferStereo16().
◆ s_rawend
◆ s_rawsamples
◆ snd_scaletable
int snd_scaletable[32][256] |
|
static |
◆ snd_vol