diff options
author | Chris Robinson <[email protected]> | 2011-07-16 03:35:51 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-07-16 03:35:51 -0700 |
commit | ce6db53e5f63c5445e5884ac91d4ce4030be4198 (patch) | |
tree | 223e23c82c50bc8ea194e20b471a149e920ee105 /Alc/alcDedicated.c | |
parent | 292ea0607ddd3df4edced130cc041ba2de13cf27 (diff) |
Apply the slot gain during the effect update method
Diffstat (limited to 'Alc/alcDedicated.c')
-rw-r--r-- | Alc/alcDedicated.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Alc/alcDedicated.c b/Alc/alcDedicated.c index d12130f8..c812877a 100644 --- a/Alc/alcDedicated.c +++ b/Alc/alcDedicated.c @@ -55,38 +55,45 @@ static ALvoid DedicatedDLGUpdate(ALeffectState *effect, ALCcontext *Context, con ALdedicatedState *state = (ALdedicatedState*)effect; ALCdevice *device = Context->Device; const ALfloat *SpeakerGain; + ALfloat Gain; ALint pos; ALsizei s; pos = aluCart2LUTpos(1.0f, 0.0f); SpeakerGain = device->PanningLUT[pos]; + Gain = Slot->Gain * Slot->effect.Params.Dedicated.Gain; for(s = 0;s < MAXCHANNELS;s++) - state->gains[s] = SpeakerGain[s] * Slot->effect.Params.Dedicated.Gain; + state->gains[s] = SpeakerGain[s] * Gain; } static ALvoid DedicatedLFEUpdate(ALeffectState *effect, ALCcontext *Context, const ALeffectslot *Slot) { ALdedicatedState *state = (ALdedicatedState*)effect; + ALfloat Gain; ALsizei s; (void)Context; + Gain = Slot->Gain * Slot->effect.Params.Dedicated.Gain; for(s = 0;s < MAXCHANNELS;s++) state->gains[s] = 0.0f; - state->gains[LFE] = Slot->effect.Params.Dedicated.Gain; + state->gains[LFE] = Gain; } static ALvoid DedicatedProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) { ALdedicatedState *state = (ALdedicatedState*)effect; const ALfloat *gains = state->gains; - ALuint i; + ALuint i, s; + (void)Slot; for(i = 0;i < SamplesToDo;i++) { - ALsizei s; + ALfloat sample; + + sample = SamplesIn[i]; for(s = 0;s < MAXCHANNELS;s++) - SamplesOut[i][s] = SamplesIn[i] * gains[s] * Slot->Gain; + SamplesOut[i][s] = sample * gains[s]; } } |