aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alcDedicated.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/alcDedicated.c')
-rw-r--r--Alc/alcDedicated.c51
1 files changed, 13 insertions, 38 deletions
diff --git a/Alc/alcDedicated.c b/Alc/alcDedicated.c
index c812877a..cba97eae 100644
--- a/Alc/alcDedicated.c
+++ b/Alc/alcDedicated.c
@@ -50,7 +50,7 @@ static ALboolean DedicatedDeviceUpdate(ALeffectState *effect, ALCdevice *Device)
return AL_TRUE;
}
-static ALvoid DedicatedDLGUpdate(ALeffectState *effect, ALCcontext *Context, const ALeffectslot *Slot)
+static ALvoid DedicatedUpdate(ALeffectState *effect, ALCcontext *Context, const ALeffectslot *Slot)
{
ALdedicatedState *state = (ALdedicatedState*)effect;
ALCdevice *device = Context->Device;
@@ -59,25 +59,20 @@ static ALvoid DedicatedDLGUpdate(ALeffectState *effect, ALCcontext *Context, con
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] * Gain;
-}
+ state->gains[s] = 0.0f;
-static ALvoid DedicatedLFEUpdate(ALeffectState *effect, ALCcontext *Context, const ALeffectslot *Slot)
-{
- ALdedicatedState *state = (ALdedicatedState*)effect;
- ALfloat Gain;
- ALsizei s;
- (void)Context;
+ if(Slot->effect.type == AL_EFFECT_DEDICATED_DIALOGUE)
+ {
+ 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] = 0.0f;
- state->gains[LFE] = Gain;
+ for(s = 0;s < MAXCHANNELS;s++)
+ state->gains[s] = SpeakerGain[s] * Gain;
+ }
+ else if(Slot->effect.type == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT)
+ state->gains[LFE] = Gain;
}
static ALvoid DedicatedProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS])
@@ -97,27 +92,7 @@ static ALvoid DedicatedProcess(ALeffectState *effect, const ALeffectslot *Slot,
}
}
-ALeffectState *DedicatedDLGCreate(void)
-{
- ALdedicatedState *state;
- ALsizei s;
-
- state = malloc(sizeof(*state));
- if(!state)
- return NULL;
-
- state->state.Destroy = DedicatedDestroy;
- state->state.DeviceUpdate = DedicatedDeviceUpdate;
- state->state.Update = DedicatedDLGUpdate;
- state->state.Process = DedicatedProcess;
-
- for(s = 0;s < MAXCHANNELS;s++)
- state->gains[s] = 0.0f;
-
- return &state->state;
-}
-
-ALeffectState *DedicatedLFECreate(void)
+ALeffectState *DedicatedCreate(void)
{
ALdedicatedState *state;
ALsizei s;
@@ -128,7 +103,7 @@ ALeffectState *DedicatedLFECreate(void)
state->state.Destroy = DedicatedDestroy;
state->state.DeviceUpdate = DedicatedDeviceUpdate;
- state->state.Update = DedicatedLFEUpdate;
+ state->state.Update = DedicatedUpdate;
state->state.Process = DedicatedProcess;
for(s = 0;s < MAXCHANNELS;s++)