diff options
author | Chris Robinson <[email protected]> | 2010-08-07 02:32:16 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-08-07 02:32:16 -0700 |
commit | d6dc855511982a76be8289966842030d135a8578 (patch) | |
tree | 065dd6e03830fb76590fbbd8747df3489e9424fb | |
parent | 8f49f2c25ef0f6221cb49c344560d9760a4d0790 (diff) |
Set up increment once
-rw-r--r-- | Alc/mixer.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index 1d4c388e..6b0406be 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -156,6 +156,17 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext, wetGainStep[i] = (ALSource->Params.WetGains[i]-WetSend[i]) / rampLength; + /* Compute 18.14 fixed point step */ + if(ALSource->Params.Pitch > (float)MAX_PITCH) + increment = MAX_PITCH << FRACTIONBITS; + else if(!(ALSource->Params.Pitch > 0.f)) + increment = (1<<FRACTIONBITS); + else + { + increment = (ALint)(ALSource->Params.Pitch*(1L<<FRACTIONBITS)); + if(increment == 0) increment = 1; + } + DryFilter = &ALSource->Params.iirFilter; for(i = 0;i < MAX_SENDS;i++) { @@ -231,17 +242,6 @@ static void MixSource(ALsource *ALSource, ALCcontext *ALContext, else memset(&Data[DataSize*Channels], 0, (BUFFER_PADDING*Channels*Bytes)); - /* Compute 18.14 fixed point step */ - if(ALSource->Params.Pitch > (float)MAX_PITCH) - increment = MAX_PITCH << FRACTIONBITS; - else if(!(ALSource->Params.Pitch > 0.f)) - increment = (1<<FRACTIONBITS); - else - { - increment = (ALint)(ALSource->Params.Pitch*(1L<<FRACTIONBITS)); - if(increment == 0) increment = 1; - } - /* Figure out how many samples we can mix. */ DataSize64 = LoopEnd; DataSize64 <<= FRACTIONBITS; |