diff options
-rw-r--r-- | Alc/alcDedicated.c | 51 | ||||
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 3 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 4 |
3 files changed, 16 insertions, 42 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++) diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index 5fcfce7d..28d890cc 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -50,8 +50,7 @@ ALeffectState *EAXVerbCreate(void); ALeffectState *VerbCreate(void); ALeffectState *EchoCreate(void); ALeffectState *ModulatorCreate(void); -ALeffectState *DedicatedDLGCreate(void); -ALeffectState *DedicatedLFECreate(void); +ALeffectState *DedicatedCreate(void); #define ALEffect_Destroy(a) ((a)->Destroy((a))) #define ALEffect_DeviceUpdate(a,b) ((a)->DeviceUpdate((a),(b))) diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index a55a00c8..b812e995 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -535,9 +535,9 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *EffectSlot, AL else if(effect->type == AL_EFFECT_RING_MODULATOR) NewState = ModulatorCreate(); else if(effect->type == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT) - NewState = DedicatedLFECreate(); + NewState = DedicatedCreate(); else if(effect->type == AL_EFFECT_DEDICATED_DIALOGUE) - NewState = DedicatedDLGCreate(); + NewState = DedicatedCreate(); /* No new state? An error occured.. */ if(NewState == NULL || ALEffect_DeviceUpdate(NewState, Context->Device) == AL_FALSE) |