aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-08-26 19:08:50 -0700
committerChris Robinson <[email protected]>2018-08-26 19:08:50 -0700
commita3010f50be7396a96e6872600b4a3c2a3b79a107 (patch)
tree052a18125c8d28ae888b95369f4b7d2b13bcc69f /Alc
parent4be6584850e8e8d9958d00d5aa8dc548743671d5 (diff)
Pack two arrays into one
Diffstat (limited to 'Alc')
-rw-r--r--Alc/effects/autowah.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/Alc/effects/autowah.c b/Alc/effects/autowah.c
index d7cb662a..5a222bfd 100644
--- a/Alc/effects/autowah.c
+++ b/Alc/effects/autowah.c
@@ -46,8 +46,10 @@ typedef struct ALautowahState {
ALfloat env_delay;
/* Filter components derived from the envelope. */
- ALfloat Alpha[BUFFERSIZE];
- ALfloat CosW0[BUFFERSIZE];
+ struct {
+ ALfloat cos_w0;
+ ALfloat alpha;
+ } Env[BUFFERSIZE];
struct {
/* Effect filters' history. */
@@ -96,6 +98,8 @@ static ALboolean ALautowahState_deviceUpdate(ALautowahState *state, ALCdevice *U
state->BandwidthNorm = 0.05f;
state->env_delay = 0.0f;
+ memset(state->Env, 0, sizeof(state->Env));
+
for(i = 0;i < MAX_EFFECT_CHANNELS;i++)
{
for(j = 0;j < MAX_OUTPUT_CHANNELS;j++)
@@ -154,8 +158,8 @@ static ALvoid ALautowahState_process(ALautowahState *state, ALsizei SamplesToDo,
/* Calculate the cos and alpha components for this sample's filter. */
w0 = minf((bandwidth*env_delay + freq_min), 0.46f) * F_TAU;
- state->CosW0[i] = cosf(w0);
- state->Alpha[i] = sinf(w0)/(2.0f * Q_FACTOR);
+ state->Env[i].cos_w0 = cosf(w0);
+ state->Env[i].alpha = sinf(w0)/(2.0f * Q_FACTOR);
}
state->env_delay = env_delay;
@@ -173,8 +177,8 @@ static ALvoid ALautowahState_process(ALautowahState *state, ALsizei SamplesToDo,
for(i = 0;i < SamplesToDo;i++)
{
- const ALfloat alpha = state->Alpha[i];
- const ALfloat cos_w0 = state->CosW0[i];
+ const ALfloat alpha = state->Env[i].alpha;
+ const ALfloat cos_w0 = state->Env[i].cos_w0;
ALfloat input, output;
ALfloat a[3], b[3];