aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-10-04 09:55:36 -0700
committerChris Robinson <[email protected]>2011-10-04 09:55:36 -0700
commiteb277cc57835d246400f724c1050cc0724e31af6 (patch)
tree97e8997e10aee3872c4763dcf0c0b32839309617 /Alc
parent20fd648729579a37e138fe2c018d075fa4e23a53 (diff)
Remove some unneeded templates and parameters
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c29
-rw-r--r--Alc/mixer.c54
2 files changed, 20 insertions, 63 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 433e1d2e..cb0eca6e 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -174,19 +174,16 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
}
Channels = ALBuffer->FmtChannels;
-
- if(ALSource->VirtualChannels && (Device->Flags&DEVICE_USE_HRTF))
- ALSource->Params.DoMix = SelectHrtfMixer(ALBuffer,
- (ALSource->Params.Step==FRACTIONONE) ? POINT_RESAMPLER :
- Resampler);
- else
- ALSource->Params.DoMix = SelectMixer(ALBuffer,
- (ALSource->Params.Step==FRACTIONONE) ? POINT_RESAMPLER :
- Resampler);
break;
}
BufferListItem = BufferListItem->next;
}
+ if(ALSource->VirtualChannels && (Device->Flags&DEVICE_USE_HRTF))
+ ALSource->Params.DoMix = SelectHrtfMixer((ALSource->Params.Step==FRACTIONONE) ?
+ POINT_RESAMPLER : Resampler);
+ else
+ ALSource->Params.DoMix = SelectMixer((ALSource->Params.Step==FRACTIONONE) ?
+ POINT_RESAMPLER : Resampler);
/* Calculate gains */
DryGain = clampf(SourceVolume, MinVolume, MaxVolume);
@@ -688,18 +685,16 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Step = 1;
}
- if((Device->Flags&DEVICE_USE_HRTF))
- ALSource->Params.DoMix = SelectHrtfMixer(ALBuffer,
- (ALSource->Params.Step==FRACTIONONE) ? POINT_RESAMPLER :
- Resampler);
- else
- ALSource->Params.DoMix = SelectMixer(ALBuffer,
- (ALSource->Params.Step==FRACTIONONE) ? POINT_RESAMPLER :
- Resampler);
break;
}
BufferListItem = BufferListItem->next;
}
+ if((Device->Flags&DEVICE_USE_HRTF))
+ ALSource->Params.DoMix = SelectHrtfMixer((ALSource->Params.Step==FRACTIONONE) ?
+ POINT_RESAMPLER : Resampler);
+ else
+ ALSource->Params.DoMix = SelectMixer((ALSource->Params.Step==FRACTIONONE) ?
+ POINT_RESAMPLER : Resampler);
if((Device->Flags&DEVICE_USE_HRTF))
{
diff --git a/Alc/mixer.c b/Alc/mixer.c
index e773426a..d72ea831 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -435,35 +435,16 @@ DECL_TEMPLATE(ALfloat, cubic32)
#undef DECL_TEMPLATE
-#define DECL_TEMPLATE(sampler) \
-static MixerFunc Select_##sampler(enum FmtType FmtType) \
-{ \
- switch(FmtType) \
- { \
- case FmtByte: \
- case FmtShort: \
- case FmtFloat: \
- return Mix_ALfloat_##sampler##32; \
- } \
- return NULL; \
-}
-
-DECL_TEMPLATE(point)
-DECL_TEMPLATE(lerp)
-DECL_TEMPLATE(cubic)
-
-#undef DECL_TEMPLATE
-
-MixerFunc SelectMixer(ALbuffer *Buffer, enum Resampler Resampler)
+MixerFunc SelectMixer(enum Resampler Resampler)
{
switch(Resampler)
{
case POINT_RESAMPLER:
- return Select_point(Buffer->FmtType);
+ return Mix_ALfloat_point32;
case LINEAR_RESAMPLER:
- return Select_lerp(Buffer->FmtType);
+ return Mix_ALfloat_lerp32;
case CUBIC_RESAMPLER:
- return Select_cubic(Buffer->FmtType);
+ return Mix_ALfloat_cubic32;
case RESAMPLER_MIN:
case RESAMPLER_MAX:
break;
@@ -471,35 +452,16 @@ MixerFunc SelectMixer(ALbuffer *Buffer, enum Resampler Resampler)
return NULL;
}
-#define DECL_TEMPLATE(sampler) \
-static MixerFunc Select_Hrtf_##sampler(enum FmtType FmtType) \
-{ \
- switch(FmtType) \
- { \
- case FmtByte: \
- case FmtShort: \
- case FmtFloat: \
- return Mix_Hrtf_ALfloat_##sampler##32; \
- } \
- return NULL; \
-}
-
-DECL_TEMPLATE(point)
-DECL_TEMPLATE(lerp)
-DECL_TEMPLATE(cubic)
-
-#undef DECL_TEMPLATE
-
-MixerFunc SelectHrtfMixer(ALbuffer *Buffer, enum Resampler Resampler)
+MixerFunc SelectHrtfMixer(enum Resampler Resampler)
{
switch(Resampler)
{
case POINT_RESAMPLER:
- return Select_Hrtf_point(Buffer->FmtType);
+ return Mix_Hrtf_ALfloat_point32;
case LINEAR_RESAMPLER:
- return Select_Hrtf_lerp(Buffer->FmtType);
+ return Mix_Hrtf_ALfloat_lerp32;
case CUBIC_RESAMPLER:
- return Select_Hrtf_cubic(Buffer->FmtType);
+ return Mix_Hrtf_ALfloat_cubic32;
case RESAMPLER_MIN:
case RESAMPLER_MAX:
break;