diff options
-rw-r--r-- | Alc/ALu.c | 1 | ||||
-rw-r--r-- | Alc/mixer.c | 14 | ||||
-rw-r--r-- | Alc/mixer_inc.c | 4 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 7 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 3 |
5 files changed, 18 insertions, 11 deletions
@@ -1504,7 +1504,6 @@ void aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) state = device->Hrtf; for(c = 0;c < device->Dry.NumChannels;c++) { - typedef ALfloat ALfloat2[2]; HrtfMix(device->RealOut.Buffer[lidx], device->RealOut.Buffer[ridx], device->Dry.Buffer[c], state->Offset, state->IrSize, SAFE_CONST(ALfloat2*,state->Chan[c].Coeffs), diff --git a/Alc/mixer.c b/Alc/mixer.c index 67e74396..fd2eba01 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -612,7 +612,9 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei if(!Counter) { parms->Hrtf.Old = parms->Hrtf.Target; - hrtfparams.Current = &parms->Hrtf.Target; + hrtfparams.Coeffs = SAFE_CONST(ALfloat2*,parms->Hrtf.Target.Coeffs); + hrtfparams.Delay[0] = parms->Hrtf.Target.Delay[0]; + hrtfparams.Delay[1] = parms->Hrtf.Target.Delay[1]; hrtfparams.Gain = parms->Hrtf.Target.Gain; hrtfparams.GainStep = 0.0f; MixHrtfSamples( @@ -631,7 +633,9 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei * So it needs to fade out over DstBufferSize instead * of Counter. */ - hrtfparams.Current = &parms->Hrtf.Old; + hrtfparams.Coeffs = SAFE_CONST(ALfloat2*,parms->Hrtf.Old.Coeffs); + hrtfparams.Delay[0] = parms->Hrtf.Old.Delay[0]; + hrtfparams.Delay[1] = parms->Hrtf.Old.Delay[1]; hrtfparams.Gain = parms->Hrtf.Old.Gain; hrtfparams.GainStep = -hrtfparams.Gain / (ALfloat)DstBufferSize; @@ -648,8 +652,10 @@ ALboolean MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei * fade time this mix handles. */ gain = lerp(parms->Hrtf.Old.Gain, parms->Hrtf.Target.Gain, - minf(1.0f, (ALfloat)Counter / (ALfloat)DstBufferSize)); - hrtfparams.Current = &parms->Hrtf.Target; + minf(1.0f, (ALfloat)Counter/DstBufferSize)); + hrtfparams.Coeffs = SAFE_CONST(ALfloat2*,parms->Hrtf.Target.Coeffs); + hrtfparams.Delay[0] = parms->Hrtf.Target.Delay[0]; + hrtfparams.Delay[1] = parms->Hrtf.Target.Delay[1]; hrtfparams.Gain = 0.0f; hrtfparams.GainStep = gain / (ALfloat)DstBufferSize; MixHrtfSamples( diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c index b42b0fd3..ee3286e9 100644 --- a/Alc/mixer_inc.c +++ b/Alc/mixer_inc.c @@ -23,8 +23,8 @@ void MixHrtf(ALfloat *restrict LeftOut, ALfloat *restrict RightOut, const ALsizei IrSize, MixHrtfParams *hrtfparams, HrtfState *hrtfstate, ALsizei BufferSize) { - const ALfloat (*Coeffs)[2] = hrtfparams->Current->Coeffs; - ALsizei Delay[2] = { hrtfparams->Current->Delay[0], hrtfparams->Current->Delay[1] }; + const ALfloat (*Coeffs)[2] = ASSUME_ALIGNED(hrtfparams->Coeffs, 16); + const ALsizei Delay[2] = { hrtfparams->Delay[0], hrtfparams->Delay[1] }; ALfloat gainstep = hrtfparams->GainStep; ALfloat gain = hrtfparams->Gain; ALfloat left, right; diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 7663e58d..ac89adf8 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -1024,10 +1024,11 @@ void FillCPUCaps(ALuint capfilter); vector_al_string SearchDataFiles(const char *match, const char *subdir); -/* Small hack to use a pointer-to-array type as a normal argument type. - * Shouldn't be used directly. */ +/* Small hack to use a pointer-to-array types as a normal argument type. + * Shouldn't be used directly. + */ typedef ALfloat ALfloatBUFFERSIZE[BUFFERSIZE]; - +typedef ALfloat ALfloat2[2]; #ifdef __cplusplus } diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 72f33be2..48520b41 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -116,7 +116,8 @@ enum ActiveFilters { typedef struct MixHrtfParams { - const HrtfParams *Current; + const ALfloat (*Coeffs)[2]; + ALsizei Delay[2]; ALfloat Gain; ALfloat GainStep; } MixHrtfParams; |