horrible hack for `fixing' glitchy sound effects when a stream is shared by

more than one object
This commit is contained in:
Bill Currie 2003-04-15 04:19:33 +00:00
parent 5505aba316
commit 37fa93e8e5
1 changed files with 16 additions and 0 deletions

View File

@ -421,6 +421,10 @@ SND_PaintChannelFrom8 (channel_t *ch, sfxbuffer_t *sc, int count)
byte *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length;
if (pos < 0) { // FIXME need a better way to handle shared streams
pos = sc->tail;
ch->pos = sc->pos;
}
samps = sc->data + pos;
if (pos + count > sc->length) {
@ -440,6 +444,10 @@ SND_PaintChannelFrom16 (channel_t *ch, sfxbuffer_t *sc, int count)
short *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length;
if (pos < 0) { // FIXME need a better way to handle shared streams
pos = sc->tail;
ch->pos = sc->pos;
}
samps = (short *) sc->data + pos;
if (pos + count > sc->length) {
@ -459,6 +467,10 @@ SND_PaintChannelStereo8 (channel_t *ch, sfxbuffer_t *sc, int count)
short *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length;
if (pos < 0) { // FIXME need a better way to handle shared streams
pos = sc->tail;
ch->pos = sc->pos;
}
samps = (short *) sc->data + pos;
if (pos + count > sc->length) {
@ -478,6 +490,10 @@ SND_PaintChannelStereo16 (channel_t *ch, sfxbuffer_t *sc, int count)
int *samps;
pos = (ch->pos - sc->pos + sc->tail) % sc->length;
if (pos < 0) { // FIXME need a better way to handle shared streams
pos = sc->tail;
ch->pos = sc->pos;
}
samps = (int *) sc->data + pos;
if (pos + count > sc->length) {