From 3b2fcb3ef6f00d026f06ca154060b29ded3eb3fc Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 2 Jun 2014 19:19:22 -0700 Subject: Avoid a loop when updating the source position variables --- Alc/mixer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Alc/mixer.c') 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; -- cgit v1.2.3