mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
horrible hack for `fixing' glitchy sound effects when a stream is shared by
more than one object
This commit is contained in:
parent
5505aba316
commit
37fa93e8e5
1 changed files with 16 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue