From 4f5aafe59f936084d60f782122ca59db3d51dae0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 15 Oct 2012 01:37:37 -0700 Subject: Put the HRTF DirectParams into an anonymous struct --- Alc/ALu.c | 52 ++++++++++++++++++++++++++-------------------------- Alc/mixer_inc.c | 18 +++++++++--------- 2 files changed, 35 insertions(+), 35 deletions(-) (limited to 'Alc') diff --git a/Alc/ALu.c b/Alc/ALu.c index d0c17c0a..a30b396e 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -365,12 +365,12 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) if(chans[c].channel == LFE) { /* Skip LFE */ - ALSource->Params.Direct.Hrtf.Delay[c][0] = 0; - ALSource->Params.Direct.Hrtf.Delay[c][1] = 0; + ALSource->Params.Direct.Hrtf.Params.Delay[c][0] = 0; + ALSource->Params.Direct.Hrtf.Params.Delay[c][1] = 0; for(i = 0;i < HRIR_LENGTH;i++) { - ALSource->Params.Direct.Hrtf.Coeffs[c][i][0] = 0.0f; - ALSource->Params.Direct.Hrtf.Coeffs[c][i][1] = 0.0f; + ALSource->Params.Direct.Hrtf.Params.Coeffs[c][i][0] = 0.0f; + ALSource->Params.Direct.Hrtf.Params.Coeffs[c][i][1] = 0.0f; } } else @@ -379,14 +379,14 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) * channel. */ GetLerpedHrtfCoeffs(Device->Hrtf, 0.0f, chans[c].angle, DryGain, - ALSource->Params.Direct.Hrtf.Coeffs[c], - ALSource->Params.Direct.Hrtf.Delay[c]); + ALSource->Params.Direct.Hrtf.Params.Coeffs[c], + ALSource->Params.Direct.Hrtf.Params.Delay[c]); } } ALSource->Hrtf.Counter = 0; - ALSource->Params.Direct.Hrtf.IrSize = GetHrtfIrSize(Device->Hrtf); + ALSource->Params.Direct.Hrtf.Params.IrSize = GetHrtfIrSize(Device->Hrtf); - ALSource->Params.Direct.hrtfState = &ALSource->Hrtf; + ALSource->Params.Direct.Hrtf.State = &ALSource->Hrtf; } else { @@ -794,8 +794,8 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) if(ALSource->Hrtf.Moving) { /* Calculate the normalized HRTF transition factor (delta). */ - delta = CalcHrtfDelta(ALSource->Params.Direct.Hrtf.Gain, DryGain, - ALSource->Params.Direct.Hrtf.Dir, Position); + delta = CalcHrtfDelta(ALSource->Params.Direct.Hrtf.Params.Gain, DryGain, + ALSource->Params.Direct.Hrtf.Params.Dir, Position); /* If the delta is large enough, get the moving HRIR target * coefficients, target delays, steppping values, and counter. */ if(delta > 0.001f) @@ -803,32 +803,32 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALSource->Hrtf.Counter = GetMovingHrtfCoeffs(Device->Hrtf, ev, az, DryGain, delta, ALSource->Hrtf.Counter, - ALSource->Params.Direct.Hrtf.Coeffs[0], - ALSource->Params.Direct.Hrtf.Delay[0], - ALSource->Params.Direct.Hrtf.CoeffStep, - ALSource->Params.Direct.Hrtf.DelayStep); - ALSource->Params.Direct.Hrtf.Gain = DryGain; - ALSource->Params.Direct.Hrtf.Dir[0] = Position[0]; - ALSource->Params.Direct.Hrtf.Dir[1] = Position[1]; - ALSource->Params.Direct.Hrtf.Dir[2] = Position[2]; + ALSource->Params.Direct.Hrtf.Params.Coeffs[0], + ALSource->Params.Direct.Hrtf.Params.Delay[0], + ALSource->Params.Direct.Hrtf.Params.CoeffStep, + ALSource->Params.Direct.Hrtf.Params.DelayStep); + ALSource->Params.Direct.Hrtf.Params.Gain = DryGain; + ALSource->Params.Direct.Hrtf.Params.Dir[0] = Position[0]; + ALSource->Params.Direct.Hrtf.Params.Dir[1] = Position[1]; + ALSource->Params.Direct.Hrtf.Params.Dir[2] = Position[2]; } } else { /* Get the initial (static) HRIR coefficients and delays. */ GetLerpedHrtfCoeffs(Device->Hrtf, ev, az, DryGain, - ALSource->Params.Direct.Hrtf.Coeffs[0], - ALSource->Params.Direct.Hrtf.Delay[0]); + ALSource->Params.Direct.Hrtf.Params.Coeffs[0], + ALSource->Params.Direct.Hrtf.Params.Delay[0]); ALSource->Hrtf.Counter = 0; ALSource->Hrtf.Moving = AL_TRUE; - ALSource->Params.Direct.Hrtf.Gain = DryGain; - ALSource->Params.Direct.Hrtf.Dir[0] = Position[0]; - ALSource->Params.Direct.Hrtf.Dir[1] = Position[1]; - ALSource->Params.Direct.Hrtf.Dir[2] = Position[2]; + ALSource->Params.Direct.Hrtf.Params.Gain = DryGain; + ALSource->Params.Direct.Hrtf.Params.Dir[0] = Position[0]; + ALSource->Params.Direct.Hrtf.Params.Dir[1] = Position[1]; + ALSource->Params.Direct.Hrtf.Params.Dir[2] = Position[2]; } - ALSource->Params.Direct.Hrtf.IrSize = GetHrtfIrSize(Device->Hrtf); + ALSource->Params.Direct.Hrtf.Params.IrSize = GetHrtfIrSize(Device->Hrtf); - ALSource->Params.Direct.hrtfState = &ALSource->Hrtf; + ALSource->Params.Direct.Hrtf.State = &ALSource->Hrtf; } else { diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c index e836db45..97266d40 100644 --- a/Alc/mixer_inc.c +++ b/Alc/mixer_inc.c @@ -35,15 +35,15 @@ void MixDirect_Hrtf(const DirectParams *params, const ALfloat *RESTRICT data, AL ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = params->OutBuffer; ALfloat *RESTRICT ClickRemoval = params->ClickRemoval; ALfloat *RESTRICT PendingClicks = params->PendingClicks; - const ALuint IrSize = params->Hrtf.IrSize; - const ALint *RESTRICT DelayStep = params->Hrtf.DelayStep; - const ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.CoeffStep; - const ALfloat (*RESTRICT TargetCoeffs)[2] = params->Hrtf.Coeffs[srcchan]; - const ALuint *RESTRICT TargetDelay = params->Hrtf.Delay[srcchan]; - ALfloat *RESTRICT History = params->hrtfState->History[srcchan]; - ALfloat (*RESTRICT Values)[2] = params->hrtfState->Values[srcchan]; - ALint Counter = maxu(params->hrtfState->Counter, OutPos) - OutPos; - ALuint Offset = params->hrtfState->Offset + OutPos; + const ALuint IrSize = params->Hrtf.Params.IrSize; + const ALint *RESTRICT DelayStep = params->Hrtf.Params.DelayStep; + const ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.Params.CoeffStep; + const ALfloat (*RESTRICT TargetCoeffs)[2] = params->Hrtf.Params.Coeffs[srcchan]; + const ALuint *RESTRICT TargetDelay = params->Hrtf.Params.Delay[srcchan]; + ALfloat *RESTRICT History = params->Hrtf.State->History[srcchan]; + ALfloat (*RESTRICT Values)[2] = params->Hrtf.State->Values[srcchan]; + ALint Counter = maxu(params->Hrtf.State->Counter, OutPos) - OutPos; + ALuint Offset = params->Hrtf.State->Offset + OutPos; ALIGN(16) ALfloat Coeffs[HRIR_LENGTH][2]; ALuint Delay[2]; ALfloat left, right; -- cgit v1.2.3