summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALu.c44
-rw-r--r--Alc/mixer.c8
-rw-r--r--OpenAL32/Include/alSource.h6
3 files changed, 29 insertions, 29 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 2758bb90..77acec7b 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -270,12 +270,12 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
if(chans[c].channel == LFE)
{
/* Skip LFE */
- ALSource->Params.Hrtf.Delay[c][0] = 0;
- ALSource->Params.Hrtf.Delay[c][1] = 0;
+ ALSource->Params.Direct.Hrtf.Delay[c][0] = 0;
+ ALSource->Params.Direct.Hrtf.Delay[c][1] = 0;
for(i = 0;i < HRIR_LENGTH;i++)
{
- ALSource->Params.Hrtf.Coeffs[c][i][0] = 0.0f;
- ALSource->Params.Hrtf.Coeffs[c][i][1] = 0.0f;
+ ALSource->Params.Direct.Hrtf.Coeffs[c][i][0] = 0.0f;
+ ALSource->Params.Direct.Hrtf.Coeffs[c][i][1] = 0.0f;
}
}
else
@@ -285,8 +285,8 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
GetLerpedHrtfCoeffs(Device->Hrtf,
0.0f, chans[c].angle,
DryGain*ListenerGain,
- ALSource->Params.Hrtf.Coeffs[c],
- ALSource->Params.Hrtf.Delay[c]);
+ ALSource->Params.Direct.Hrtf.Coeffs[c],
+ ALSource->Params.Direct.Hrtf.Delay[c]);
}
}
ALSource->Hrtf.Counter = 0;
@@ -713,8 +713,8 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
if(ALSource->Hrtf.Moving)
{
/* Calculate the normalized HRTF transition factor (delta). */
- delta = CalcHrtfDelta(ALSource->Params.Hrtf.Gain, DryGain,
- ALSource->Params.Hrtf.Dir, Position);
+ delta = CalcHrtfDelta(ALSource->Params.Direct.Hrtf.Gain, DryGain,
+ ALSource->Params.Direct.Hrtf.Dir, Position);
/* If the delta is large enough, get the moving HRIR target
* coefficients, target delays, steppping values, and counter. */
if(delta > 0.001f)
@@ -722,27 +722,27 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
ALSource->Hrtf.Counter = GetMovingHrtfCoeffs(Device->Hrtf,
ev, az, DryGain, delta,
ALSource->Hrtf.Counter,
- ALSource->Params.Hrtf.Coeffs[0],
- ALSource->Params.Hrtf.Delay[0],
- ALSource->Params.Hrtf.CoeffStep,
- ALSource->Params.Hrtf.DelayStep);
- ALSource->Params.Hrtf.Gain = DryGain;
- ALSource->Params.Hrtf.Dir[0] = Position[0];
- ALSource->Params.Hrtf.Dir[1] = Position[1];
- ALSource->Params.Hrtf.Dir[2] = Position[2];
+ 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];
}
}
else
{
/* Get the initial (static) HRIR coefficients and delays. */
GetLerpedHrtfCoeffs(Device->Hrtf, ev, az, DryGain,
- ALSource->Params.Hrtf.Coeffs[0],
- ALSource->Params.Hrtf.Delay[0]);
+ ALSource->Params.Direct.Hrtf.Coeffs[0],
+ ALSource->Params.Direct.Hrtf.Delay[0]);
ALSource->Hrtf.Counter = 0;
- ALSource->Params.Hrtf.Gain = DryGain;
- ALSource->Params.Hrtf.Dir[0] = Position[0];
- ALSource->Params.Hrtf.Dir[1] = Position[1];
- ALSource->Params.Hrtf.Dir[2] = Position[2];
+ 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];
}
}
else
diff --git a/Alc/mixer.c b/Alc/mixer.c
index e2e80054..7dd4bbe4 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -106,10 +106,10 @@ static void MixDirect_Hrtf_##sampler(ALsource *Source, ALCdevice *Device, \
ALuint SamplesToDo, ALuint BufferSize) \
{ \
const ALuint NumChannels = Source->NumChannels; \
- const ALint *RESTRICT DelayStep = Source->Params.Hrtf.DelayStep; \
+ const ALint *RESTRICT DelayStep = Source->Params.Direct.Hrtf.DelayStep; \
ALfloat (*RESTRICT DryBuffer)[MAXCHANNELS]; \
ALfloat *RESTRICT ClickRemoval, *RESTRICT PendingClicks; \
- ALfloat (*RESTRICT CoeffStep)[2] = Source->Params.Hrtf.CoeffStep; \
+ ALfloat (*RESTRICT CoeffStep)[2] = Source->Params.Direct.Hrtf.CoeffStep; \
ALuint pos, frac; \
FILTER *DryFilter; \
ALuint BufferIdx; \
@@ -126,8 +126,8 @@ static void MixDirect_Hrtf_##sampler(ALsource *Source, ALCdevice *Device, \
\
for(i = 0;i < NumChannels;i++) \
{ \
- ALfloat (*RESTRICT TargetCoeffs)[2] = Source->Params.Hrtf.Coeffs[i]; \
- ALuint *RESTRICT TargetDelay = Source->Params.Hrtf.Delay[i]; \
+ ALfloat (*RESTRICT TargetCoeffs)[2] = Source->Params.Direct.Hrtf.Coeffs[i];\
+ ALuint *RESTRICT TargetDelay = Source->Params.Direct.Hrtf.Delay[i]; \
ALfloat *RESTRICT History = Source->Hrtf.History[i]; \
ALfloat (*RESTRICT Values)[2] = Source->Hrtf.Values[i]; \
ALint Counter = maxu(Source->Hrtf.Counter, OutPos) - OutPos; \
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index 53286a03..88ced697 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -46,9 +46,11 @@ typedef struct HrtfParams {
} HrtfParams;
typedef struct DirectParams {
+ HrtfParams Hrtf;
+
/* A mixing matrix. First subscript is the channel number of the input data
* (regardless of channel configuration) and the second is the channel
- * target (eg. FRONT_LEFT). */
+ * target (eg. FRONT_LEFT). Not used with HRTF. */
ALfloat Gains[MAXCHANNELS][MAXCHANNELS];
/* A low-pass filter, using 2 chained one-pole filters. */
@@ -150,8 +152,6 @@ typedef struct ALsource
ALint Step;
- HrtfParams Hrtf;
-
DirectParams Direct;
struct ALeffectslot *Slot[MAX_SENDS];