aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-10-14 10:57:11 -0700
committerChris Robinson <[email protected]>2012-10-14 10:57:11 -0700
commit0b679167c9147fc92aad32487c03dffb5ce6817f (patch)
tree9dbe9bd30451859d2a9fc83eda4ed81a28ac426d /Alc
parent5ac0a93fbab37cfce1b1a2546295eee37e7ee2d4 (diff)
Store some more HRTF info in the DirectParams struct
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c6
-rw-r--r--Alc/mixer_inc.c11
2 files changed, 12 insertions, 5 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b7209172..821160a8 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -384,6 +384,9 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
}
}
ALSource->Hrtf.Counter = 0;
+ ALSource->Params.Direct.Hrtf.IrSize = GetHrtfIrSize(Device->Hrtf);
+
+ ALSource->Params.Direct.hrtfState = &ALSource->Hrtf;
}
else
{
@@ -815,6 +818,9 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Params.Direct.Hrtf.Dir[1] = Position[1];
ALSource->Params.Direct.Hrtf.Dir[2] = Position[2];
}
+ ALSource->Params.Direct.Hrtf.IrSize = GetHrtfIrSize(Device->Hrtf);
+
+ ALSource->Params.Direct.hrtfState = &ALSource->Hrtf;
}
else
{
diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c
index 1d9ac5cd..a581d5ac 100644
--- a/Alc/mixer_inc.c
+++ b/Alc/mixer_inc.c
@@ -36,20 +36,21 @@ void MixDirect_Hrtf(ALsource *Source, ALCdevice *Device, DirectParams *params,
ALfloat (*RESTRICT DryBuffer)[BUFFERSIZE] = Device->DryBuffer;
ALfloat *RESTRICT ClickRemoval = Device->ClickRemoval;
ALfloat *RESTRICT PendingClicks = Device->PendingClicks;
- const ALuint IrSize = GetHrtfIrSize(Device->Hrtf);
+ const ALuint IrSize = params->Hrtf.IrSize;
const ALint *RESTRICT DelayStep = params->Hrtf.DelayStep;
ALfloat (*RESTRICT CoeffStep)[2] = params->Hrtf.CoeffStep;
ALfloat (*RESTRICT TargetCoeffs)[2] = params->Hrtf.Coeffs[srcchan];
ALuint *RESTRICT TargetDelay = params->Hrtf.Delay[srcchan];
- ALfloat *RESTRICT History = Source->Hrtf.History[srcchan];
- ALfloat (*RESTRICT Values)[2] = Source->Hrtf.Values[srcchan];
- ALint Counter = maxu(Source->Hrtf.Counter, OutPos) - OutPos;
- ALuint Offset = Source->Hrtf.Offset + OutPos;
+ 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;
ALIGN(16) ALfloat Coeffs[HRIR_LENGTH][2];
ALuint Delay[2];
ALfloat left, right;
ALuint pos;
ALuint c;
+ (void)Source;
pos = 0;
for(c = 0;c < IrSize;c++)