diff options
author | Chris Robinson <[email protected]> | 2012-09-14 04:13:18 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-09-14 04:13:18 -0700 |
commit | 7635afcb520747b74b7c65bb522016c2c7c2da4d (patch) | |
tree | 85eba69b24c5c089730636c10aa46dda361cc86a /Alc/ALu.c | |
parent | 74aee374a646aec1b1ebe40f9efbae692e9720d6 (diff) |
Use a source param for the resampler and move them to the mixer source
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -51,6 +51,27 @@ ALfloat ConeScale = 1.0f; ALfloat ZScale = 1.0f; +static ResamplerFunc SelectResampler(enum Resampler Resampler, ALuint increment) +{ + if(increment == FRACTIONONE) + return Resample_point32_C; + switch(Resampler) + { + case PointResampler: + return Resample_point32_C; + case LinearResampler: + return Resample_lerp32_C; + case CubicResampler: + return Resample_cubic32_C; + case ResamplerMax: + /* Shouldn't happen */ + break; + } + + return NULL; +} + + static DryMixerFunc SelectDirectMixer(void) { #ifdef HAVE_SSE @@ -210,6 +231,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) if(ALSource->Params.Step == 0) ALSource->Params.Step = 1; } + ALSource->Params.Resample = SelectResampler(Resampler, ALSource->Params.Step); Channels = ALBuffer->FmtChannels; break; @@ -703,6 +725,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) if(ALSource->Params.Step == 0) ALSource->Params.Step = 1; } + ALSource->Params.Resample = SelectResampler(Resampler, ALSource->Params.Step); break; } |