diff options
author | Chris Robinson <[email protected]> | 2011-05-02 02:22:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-02 02:22:30 -0700 |
commit | f843b7e2e362d3fc521771cdf8847de0a6f3a8d0 (patch) | |
tree | 00a92ec18d12f64713be07a111ceb1ea7872b74e /OpenAL32 | |
parent | eea86ab8916c5e0213dabc404a191bbf0e0affbe (diff) |
Implement HRTF mixers for multi-channel sources
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alSource.h | 4 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index 30b949db..ee342f92 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -87,7 +87,7 @@ typedef struct ALsource ALint lSourceType; /* HRTF info */ - ALfloat HrtfHistory[HRTF_LENGTH]; + ALfloat HrtfHistory[MAXCHANNELS][HRTF_LENGTH]; ALuint HrtfOffset; // Current target parameters used for mixing @@ -95,7 +95,7 @@ typedef struct ALsource struct { ALint Step; - ALfloat HrtfCoeffs[HRTF_LENGTH][2]; + ALfloat HrtfCoeffs[MAXCHANNELS][HRTF_LENGTH][2]; /* A mixing matrix. First subscript is the channel number of the input * data (regardless of channel configuration) and the second is the diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 14beb85f..d6e9b18a 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -1349,8 +1349,12 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources) Source->Buffer = Source->queue->buffer; - for(j = 0;j < HRTF_LENGTH;j++) - Source->HrtfHistory[j] = 0.0f; + for(j = 0;j < MAXCHANNELS;j++) + { + ALuint k; + for(k = 0;k < HRTF_LENGTH;k++) + Source->HrtfHistory[j][k] = 0.0f; + } Source->HrtfOffset = 0; } else |