From e79d9bdd1a6aa6d6d9852bf5a380a8cd01cbc315 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 17 Nov 2018 23:21:37 -0800 Subject: Move the vector and matrix declarations to a separate header --- Alc/alc.cpp | 2 +- Alc/alu.cpp | 7 ------- Alc/effects/autowah.cpp | 3 ++- Alc/effects/compressor.cpp | 4 +++- Alc/effects/equalizer.cpp | 3 ++- Alc/effects/modulator.cpp | 3 ++- Alc/effects/reverb.cpp | 1 + 7 files changed, 11 insertions(+), 12 deletions(-) (limited to 'Alc') diff --git a/Alc/alc.cpp b/Alc/alc.cpp index ec9a0adf..daa0818d 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2658,7 +2658,7 @@ static ALvoid InitContext(ALCcontext *Context) Context->ExtensionList = alExtList; - listener->Params.Matrix = IdentityMatrixf; + listener->Params.Matrix = aluMatrixf::Identity; aluVectorSet(&listener->Params.Velocity, 0.0f, 0.0f, 0.0f, 0.0f); listener->Params.Gain = listener->Gain; listener->Params.MetersPerUnit = Context->MetersPerUnit; diff --git a/Alc/alu.cpp b/Alc/alu.cpp index 1895b777..2a6dcfe0 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -56,13 +56,6 @@ ALfloat ZScale = 1.0f; /* Force default speed of sound for distance-related reverb decay. */ ALboolean OverrideReverbSpeedOfSound = AL_FALSE; -const aluMatrixf IdentityMatrixf = {{ - { 1.0f, 0.0f, 0.0f, 0.0f }, - { 0.0f, 1.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 1.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f, 1.0f }, -}}; - static void ClearArray(ALfloat f[MAX_OUTPUT_CHANNELS]) { diff --git a/Alc/effects/autowah.cpp b/Alc/effects/autowah.cpp index e2f07b6f..a8e4fe6e 100644 --- a/Alc/effects/autowah.cpp +++ b/Alc/effects/autowah.cpp @@ -29,6 +29,7 @@ #include "alError.h" #include "alu.h" #include "filters/defs.h" +#include "vecmat.h" #define MIN_FREQ 20.0f #define MAX_FREQ 2500.0f @@ -131,7 +132,7 @@ static ALvoid ALautowahState_update(ALautowahState *state, const ALCcontext *con STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputePanGains(&device->FOAOut, IdentityMatrixf.m[i], slot->Params.Gain, + ComputePanGains(&device->FOAOut, aluMatrixf::Identity.m[i], slot->Params.Gain, state->Chans[i].TargetGains); } diff --git a/Alc/effects/compressor.cpp b/Alc/effects/compressor.cpp index 5603deea..464e98ec 100644 --- a/Alc/effects/compressor.cpp +++ b/Alc/effects/compressor.cpp @@ -27,6 +27,7 @@ #include "alu.h" #include "alAuxEffectSlot.h" #include "alError.h" +#include "vecmat.h" #define AMP_ENVELOPE_MIN 0.5f @@ -101,7 +102,8 @@ static ALvoid ALcompressorState_update(ALcompressorState *state, const ALCcontex STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; for(i = 0;i < 4;i++) - ComputePanGains(&device->FOAOut, IdentityMatrixf.m[i], slot->Params.Gain, state->Gain[i]); + ComputePanGains(&device->FOAOut, aluMatrixf::Identity.m[i], slot->Params.Gain, + state->Gain[i]); } static ALvoid ALcompressorState_process(ALcompressorState *state, ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/equalizer.cpp b/Alc/effects/equalizer.cpp index 48c6d1e2..e8d50fad 100644 --- a/Alc/effects/equalizer.cpp +++ b/Alc/effects/equalizer.cpp @@ -29,6 +29,7 @@ #include "alError.h" #include "alu.h" #include "filters/defs.h" +#include "vecmat.h" /* The document "Effects Extension Guide.pdf" says that low and high * @@ -173,7 +174,7 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCcontext STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputePanGains(&device->FOAOut, IdentityMatrixf.m[i], slot->Params.Gain, + ComputePanGains(&device->FOAOut, aluMatrixf::Identity.m[i], slot->Params.Gain, state->Chans[i].TargetGains); } diff --git a/Alc/effects/modulator.cpp b/Alc/effects/modulator.cpp index 7e8f8ce4..9790af79 100644 --- a/Alc/effects/modulator.cpp +++ b/Alc/effects/modulator.cpp @@ -29,6 +29,7 @@ #include "alError.h" #include "alu.h" #include "filters/defs.h" +#include "vecmat.h" #define MAX_UPDATE_SAMPLES 128 @@ -159,7 +160,7 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCcontext STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputePanGains(&device->FOAOut, IdentityMatrixf.m[i], slot->Params.Gain, + ComputePanGains(&device->FOAOut, aluMatrixf::Identity.m[i], slot->Params.Gain, state->Chans[i].TargetGains); } diff --git a/Alc/effects/reverb.cpp b/Alc/effects/reverb.cpp index fe9cc9f7..ebb9b7da 100644 --- a/Alc/effects/reverb.cpp +++ b/Alc/effects/reverb.cpp @@ -31,6 +31,7 @@ #include "alListener.h" #include "alError.h" #include "filters/defs.h" +#include "vecmat.h" /* This is a user config option for modifying the overall output of the reverb * effect. -- cgit v1.2.3