more headpos resetage

This commit is contained in:
Bill Currie 2003-04-17 03:58:16 +00:00
parent 28cc2e24ef
commit 51f7b934d1

View file

@ -172,13 +172,14 @@ SND_StreamAdvance (sfxbuffer_t *buffer, unsigned int count)
if (buffer->pos > sfx->length) {
if (sfx->loopstart == (unsigned int)-1) {
// reset the buffer and fill it incase it's needed again
headpos = buffer->pos = 0;
buffer->pos = 0;
} else {
buffer->pos -= sfx->loopstart;
buffer->pos %= sfx->length - sfx->loopstart;
buffer->pos += sfx->loopstart;
}
}
headpos = buffer->pos;
stream->seek (stream->file, buffer->pos * stepscale, info);
} else {
buffer->pos += count;