aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/dedicated.c
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2016-04-15 22:05:47 -0700
committerChris Robinson <chris.kcat@gmail.com>2016-04-15 22:05:47 -0700
commita6c70992b01b168d561c448fa235a86c9697b6ef (patch)
treec7fcc5d4d66e0f50a34e982abb954421c596c5d8 /Alc/effects/dedicated.c
parente16032e1f0c92ff23c70393eccbac7def14d4bab (diff)
More directly map coefficients for ambisonic mixing buffers
Instead of looping over all the coefficients for each channel with multiplies, when we know only one will have a non-0 factor for ambisonic mixing buffers, just index the one with a non-0 factor.
Diffstat (limited to 'Alc/effects/dedicated.c')
-rw-r--r--Alc/effects/dedicated.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c
index 9fd10177..20acfdcf 100644
--- a/Alc/effects/dedicated.c
+++ b/Alc/effects/dedicated.c
@@ -59,9 +59,9 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCdevice *
int idx;
if((idx=GetChannelIdxByName(device->RealOut, LFE)) != -1)
{
- state->gains[idx] = Gain;
STATIC_CAST(ALeffectState,state)->OutBuffer = device->RealOut.Buffer;
STATIC_CAST(ALeffectState,state)->OutChannels = device->RealOut.NumChannels;
+ state->gains[idx] = Gain;
}
}
else if(Slot->EffectType == AL_EFFECT_DEDICATED_DIALOGUE)
@@ -71,23 +71,22 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCdevice *
* plays from the front-center location. */
if((idx=GetChannelIdxByName(device->RealOut, FrontCenter)) != -1)
{
- state->gains[idx] = Gain;
STATIC_CAST(ALeffectState,state)->OutBuffer = device->RealOut.Buffer;
STATIC_CAST(ALeffectState,state)->OutChannels = device->RealOut.NumChannels;
+ state->gains[idx] = Gain;
}
else
{
+ STATIC_CAST(ALeffectState,state)->OutBuffer = device->Dry.Buffer;
+ STATIC_CAST(ALeffectState,state)->OutChannels = device->Dry.NumChannels;
if((idx=GetChannelIdxByName(device->Dry, FrontCenter)) != -1)
state->gains[idx] = Gain;
else
{
ALfloat coeffs[MAX_AMBI_COEFFS];
CalcXYZCoeffs(0.0f, 0.0f, -1.0f, coeffs);
- ComputePanningGains(device->Dry.AmbiCoeffs, device->Dry.NumChannels,
- device->Dry.CoeffCount, coeffs, Gain, state->gains);
+ ComputePanningGains(device->Dry, coeffs, Gain, state->gains);
}
- STATIC_CAST(ALeffectState,state)->OutBuffer = device->Dry.Buffer;
- STATIC_CAST(ALeffectState,state)->OutChannels = device->Dry.NumChannels;
}
}
}