summaryrefslogtreecommitdiffstats
path: root/Alc/effects/modulator.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-03 05:02:16 -0700
committerChris Robinson <[email protected]>2013-10-03 05:02:16 -0700
commit764ea95781486f86c7be956e84cf97ab893ac07b (patch)
treea6fc6b17121a2f4cab499b97a59378470fb3cb75 /Alc/effects/modulator.c
parent99fa5911bc9f427c96fe800f94d31e4942805fd2 (diff)
Use helpers to set channel gain arrays
Also avoid unnecessary clearing.
Diffstat (limited to 'Alc/effects/modulator.c')
-rw-r--r--Alc/effects/modulator.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c
index 356f0fd6..a77a42df 100644
--- a/Alc/effects/modulator.c
+++ b/Alc/effects/modulator.c
@@ -136,7 +136,6 @@ static ALboolean ALmodulatorState_deviceUpdate(ALmodulatorState *state, ALCdevic
static ALvoid ALmodulatorState_update(ALmodulatorState *state, ALCdevice *Device, const ALeffectslot *Slot)
{
ALfloat gain, cw, a;
- ALuint index;
if(Slot->EffectProps.Modulator.Waveform == AL_RING_MODULATOR_SINUSOID)
state->Waveform = SINUSOID;
@@ -161,15 +160,8 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, ALCdevice *Device
state->Filter.a[1] = -a;
state->Filter.a[2] = 0.0f;
- gain = sqrtf(1.0f/Device->NumChan);
- gain *= Slot->Gain;
- for(index = 0;index < MaxChannels;index++)
- state->Gain[index] = 0.0f;
- for(index = 0;index < Device->NumChan;index++)
- {
- enum Channel chan = Device->Speaker2Chan[index];
- state->Gain[chan] = gain;
- }
+ gain = sqrtf(1.0f/Device->NumChan) * Slot->Gain;
+ SetGains(Device, gain, state->Gain);
}
static ALvoid ALmodulatorState_process(ALmodulatorState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])