diff options
author | Chris Robinson <[email protected]> | 2017-10-23 13:26:35 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-10-23 13:26:35 -0700 |
commit | b82d2cf05555999a4b8597e2b23799b5b7023c63 (patch) | |
tree | 40d8d61708f4c278ff9dfc11b442e219a761b18e /Alc/hrtf.c | |
parent | 7d4028b2df93b6429869dd40833801ff68b44112 (diff) |
Store the HRTF distance in the Hrtf handle
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r-- | Alc/hrtf.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -305,10 +305,10 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N } -static struct Hrtf *CreateHrtfStore(ALuint rate, ALsizei irSize, ALsizei evCount, ALsizei irCount, - const ALubyte *azCount, const ALushort *evOffset, - const ALfloat (*coeffs)[2], const ALubyte (*delays)[2], - const char *filename) +static struct Hrtf *CreateHrtfStore(ALuint rate, ALsizei irSize, + ALfloat distance, ALsizei evCount, ALsizei irCount, const ALubyte *azCount, + const ALushort *evOffset, const ALfloat (*coeffs)[2], const ALubyte (*delays)[2], + const char *filename) { struct Hrtf *Hrtf; size_t total; @@ -337,6 +337,7 @@ static struct Hrtf *CreateHrtfStore(ALuint rate, ALsizei irSize, ALsizei evCount InitRef(&Hrtf->ref, 0); Hrtf->sampleRate = rate; Hrtf->irSize = irSize; + Hrtf->distance = distance; Hrtf->evCount = evCount; /* Set up pointers to storage following the main HRTF struct. */ @@ -570,7 +571,7 @@ static struct Hrtf *LoadHrtf00(const ALubyte *data, size_t datalen, const char * } } - Hrtf = CreateHrtfStore(rate, irSize, evCount, irCount, azCount, + Hrtf = CreateHrtfStore(rate, irSize, 0.0f, evCount, irCount, azCount, evOffset, coeffs, delays, filename); } @@ -718,7 +719,7 @@ static struct Hrtf *LoadHrtf01(const ALubyte *data, size_t datalen, const char * } } - Hrtf = CreateHrtfStore(rate, irSize, evCount, irCount, azCount, + Hrtf = CreateHrtfStore(rate, irSize, 0.0f, evCount, irCount, azCount, evOffset, coeffs, delays, filename); } @@ -963,8 +964,10 @@ static struct Hrtf *LoadHrtf02(const ALubyte *data, size_t datalen, const char * } } - Hrtf = CreateHrtfStore(rate, irSize, evCount, irCount, azCount, - evOffset, coeffs, delays, filename); + Hrtf = CreateHrtfStore(rate, irSize, + (ALfloat)distance / 1000.0f, evCount, irCount, azCount, evOffset, + coeffs, delays, filename + ); } free(evOffset); |