aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/hrtf.c19
-rw-r--r--Alc/hrtf.h2
2 files changed, 13 insertions, 8 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index 4f0465de..8959a0f8 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -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);
diff --git a/Alc/hrtf.h b/Alc/hrtf.h
index 0c47ded9..4fd774a7 100644
--- a/Alc/hrtf.h
+++ b/Alc/hrtf.h
@@ -22,6 +22,8 @@ struct Hrtf {
ALuint sampleRate;
ALsizei irSize;
+
+ ALfloat distance;
ALubyte evCount;
const ALubyte *azCount;