diff options
author | Chris Robinson <[email protected]> | 2014-06-02 19:19:22 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-06-02 19:19:22 -0700 |
commit | 3b2fcb3ef6f00d026f06ca154060b29ded3eb3fc (patch) | |
tree | 11f8a60f859cb32986993326b797096e8b8f3364 /Alc/mixer.c | |
parent | d2c0a43498bf128462859d1a4bd5913b30179aa7 (diff) |
Avoid a loop when updating the source position variables
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r-- | Alc/mixer.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index ef1517b3..8830a3fe 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -383,12 +383,10 @@ ALvoid MixSource(ALactivesource *src, ALCdevice *Device, ALuint SamplesToDo) } } /* Update positions */ - for(j = 0;j < DstBufferSize;j++) - { - DataPosFrac += increment; - DataPosInt += DataPosFrac>>FRACTIONBITS; - DataPosFrac &= FRACTIONMASK; - } + DataPosFrac += increment*DstBufferSize; + DataPosInt += DataPosFrac>>FRACTIONBITS; + DataPosFrac &= FRACTIONMASK; + OutPos += DstBufferSize; src->Offset += DstBufferSize; src->Direct.Counter = maxu(src->Direct.Counter, DstBufferSize) - DstBufferSize; |