diff options
author | Chris Robinson <[email protected]> | 2017-02-19 22:47:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-19 22:47:59 -0800 |
commit | 3761336e6cf49a7cd5075424b3c8c4a1f5e5b226 (patch) | |
tree | 109b4c30187680c8216186445b728c1592fad823 /OpenAL32/Include | |
parent | 9da152a9c8b9f3a6f019c77e0324772344fc9156 (diff) |
Apply distance compensation when writing to the output
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alMain.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 947a16ba..bb8a57ce 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -603,6 +603,15 @@ typedef struct HrtfEntry { TYPEDEF_VECTOR(HrtfEntry, vector_HrtfEntry) +/* Maximum delay in samples for speaker distance compensation. */ +#define MAX_DELAY_LENGTH 128 + +typedef struct DistanceComp { + ALfloat Gain; + ALsizei Length; /* Valid range is [0...MAX_DELAY_LENGTH). */ + alignas(16) ALfloat Buffer[MAX_DELAY_LENGTH]; +} DistanceComp; + /* Size for temporary storage of buffer data, in ALfloats. Larger values need * more memory, while smaller values may need more iterations. The value needs * to be a sensible size, however, as it constrains the max stepping value used @@ -723,6 +732,9 @@ struct ALCdevice_struct ALsizei NumChannels; } RealOut; + /* Delay buffers used to compensate for speaker distances. */ + DistanceComp ChannelDelay[MAX_OUTPUT_CHANNELS]; + /* Running count of the mixer invocations, in 31.1 fixed point. This * actually increments *twice* when mixing, first at the start and then at * the end, so the bottom bit indicates if the device is currently mixing |