aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-07-05 14:00:11 -0700
committerChris Robinson <[email protected]>2011-07-05 14:00:11 -0700
commit21574f7e16d8ff2826b32cf11086e5c7dbac7c30 (patch)
tree02d7d6853b82857b83e6ebe51f65d1a76804904d /Alc/mixer.c
parent0903a7f1e056079541a40f5d6dfb27756b3e883b (diff)
Scale the WetGain parameter directly instead of on each application
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r--Alc/mixer.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index ab0cda7b..4caca6e2 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -75,7 +75,6 @@ static void Mix_Hrtf_##T##_##sampler(ALsource *Source, ALCdevice *Device, \
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) \
{ \
const ALuint NumChannels = Source->NumChannels; \
- const ALfloat scaler = 1.0f/NumChannels; \
const T *RESTRICT data = srcdata; \
ALfloat (*RESTRICT DryBuffer)[MAXCHANNELS]; \
ALfloat *RESTRICT ClickRemoval, *RESTRICT PendingClicks; \
@@ -195,14 +194,14 @@ static void Mix_Hrtf_##T##_##sampler(ALsource *Source, ALCdevice *Device, \
value = sampler(data + pos*NumChannels + i, NumChannels,frac);\
value = lpFilter1PC(WetFilter, i, value); \
\
- WetClickRemoval[0] -= value*WetSend * scaler; \
+ WetClickRemoval[0] -= value * WetSend; \
} \
for(BufferIdx = 0;BufferIdx < BufferSize;BufferIdx++) \
{ \
value = sampler(data + pos*NumChannels + i, NumChannels,frac);\
value = lpFilter1P(WetFilter, i, value); \
\
- WetBuffer[OutPos] += value*WetSend * scaler; \
+ WetBuffer[OutPos] += value * WetSend; \
\
frac += increment; \
pos += frac>>FRACTIONBITS; \
@@ -214,7 +213,7 @@ static void Mix_Hrtf_##T##_##sampler(ALsource *Source, ALCdevice *Device, \
value = sampler(data + pos*NumChannels + i, NumChannels,frac);\
value = lpFilter1PC(WetFilter, i, value); \
\
- WetPendingClicks[0] += value*WetSend * scaler; \
+ WetPendingClicks[0] += value * WetSend; \
} \
OutPos -= BufferSize; \
} \
@@ -244,7 +243,6 @@ static void Mix_##T##_##sampler(ALsource *Source, ALCdevice *Device, \
ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) \
{ \
const ALuint NumChannels = Source->NumChannels; \
- const ALfloat scaler = 1.0f/NumChannels; \
const T *RESTRICT data = srcdata; \
ALfloat (*DryBuffer)[MAXCHANNELS]; \
ALfloat *ClickRemoval, *PendingClicks; \
@@ -336,14 +334,14 @@ static void Mix_##T##_##sampler(ALsource *Source, ALCdevice *Device, \
value = sampler(data + pos*NumChannels + i, NumChannels,frac);\
\
value = lpFilter1PC(WetFilter, i, value); \
- WetClickRemoval[0] -= value*WetSend * scaler; \
+ WetClickRemoval[0] -= value * WetSend; \
} \
for(BufferIdx = 0;BufferIdx < BufferSize;BufferIdx++) \
{ \
value = sampler(data + pos*NumChannels + i, NumChannels,frac);\
\
value = lpFilter1P(WetFilter, i, value); \
- WetBuffer[OutPos] += value*WetSend * scaler; \
+ WetBuffer[OutPos] += value * WetSend; \
\
frac += increment; \
pos += frac>>FRACTIONBITS; \
@@ -355,7 +353,7 @@ static void Mix_##T##_##sampler(ALsource *Source, ALCdevice *Device, \
value = sampler(data + pos*NumChannels + i, NumChannels,frac);\
\
value = lpFilter1PC(WetFilter, i, value); \
- WetPendingClicks[0] += value*WetSend * scaler; \
+ WetPendingClicks[0] += value * WetSend; \
} \
OutPos -= BufferSize; \
} \