From c80ee5b7014d12675e2c615574c9f3f3354ffd1b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 28 May 2019 16:22:36 -0700 Subject: Use std::array for most mixing buffer arrays --- OpenAL32/Include/alAuxEffectSlot.h | 2 +- OpenAL32/Include/alMain.h | 8 +++++--- OpenAL32/Include/alu.h | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'OpenAL32/Include') diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index 06681276..9956c432 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -71,7 +71,7 @@ struct ALeffectslot { ALuint id{}; /* Mixing buffer used by the Wet mix. */ - al::vector,16> MixBuffer; + al::vector MixBuffer; /* Wet buffer configuration is ACN channel order with N3D scaling. * Consequently, effects that only want to work with mono input can use diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 7019a6d4..7538ade2 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -305,6 +305,8 @@ struct BFChannelConfig { */ #define BUFFERSIZE 1024 +using FloatBufferLine = std::array; + /* Maximum number of samples to pad on either end of a buffer for resampling. * Note that both the beginning and end need padding! */ @@ -315,14 +317,14 @@ struct MixParams { /* Coefficient channel mapping for mixing to the buffer. */ std::array AmbiMap; - ALfloat (*Buffer)[BUFFERSIZE]{nullptr}; + FloatBufferLine *Buffer{nullptr}; ALsizei NumChannels{0}; }; struct RealMixParams { std::array ChannelIndex{}; - ALfloat (*Buffer)[BUFFERSIZE]{nullptr}; + FloatBufferLine *Buffer{nullptr}; ALsizei NumChannels{0}; }; @@ -405,7 +407,7 @@ struct ALCdevice { alignas(16) float2 HrtfAccumData[BUFFERSIZE + HRIR_LENGTH]; /* Mixing buffer used by the Dry mix and Real output. */ - al::vector, 16> MixBuffer; + al::vector MixBuffer; /* The "dry" path corresponds to the main output. */ MixParams Dry; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 642aeddc..327adfc0 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -263,7 +263,7 @@ struct ALvoice { int FilterType; DirectParams Params[MAX_INPUT_CHANNELS]; - ALfloat (*Buffer)[BUFFERSIZE]; + FloatBufferLine *Buffer; ALsizei Channels; ALsizei ChannelsPerOrder[MAX_AMBI_ORDER+1]; } mDirect; @@ -272,7 +272,7 @@ struct ALvoice { int FilterType; SendParams Params[MAX_INPUT_CHANNELS]; - ALfloat (*Buffer)[BUFFERSIZE]; + FloatBufferLine *Buffer; ALsizei Channels; }; al::FlexArray mSend; -- cgit v1.2.3