aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-09-24 10:18:29 -0700
committerChris Robinson <[email protected]>2015-09-24 10:18:29 -0700
commitef4337092708aa8e1c303abf582a9bab993751bd (patch)
tree4aa471219085648156779a31a6bb31026103b53b /Alc/ALc.c
parent64858e3e94eb98179985f602035b42972752082a (diff)
Use a local var instead of multiple double-dereferencing
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 9002c1ee..bba0def2 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2319,24 +2319,25 @@ static ALCdevice *VerifyDevice(ALCdevice *device)
*/
static ALvoid InitContext(ALCcontext *Context)
{
+ ALlistener *listener = Context->Listener;
//Initialise listener
- Context->Listener->Gain = 1.0f;
- Context->Listener->MetersPerUnit = 1.0f;
- aluVectorSet(&Context->Listener->Position, 0.0f, 0.0f, 0.0f, 1.0f);
- aluVectorSet(&Context->Listener->Velocity, 0.0f, 0.0f, 0.0f, 0.0f);
- Context->Listener->Forward[0] = 0.0f;
- Context->Listener->Forward[1] = 0.0f;
- Context->Listener->Forward[2] = -1.0f;
- Context->Listener->Up[0] = 0.0f;
- Context->Listener->Up[1] = 1.0f;
- Context->Listener->Up[2] = 0.0f;
- aluMatrixSet(&Context->Listener->Params.Matrix,
+ listener->Gain = 1.0f;
+ listener->MetersPerUnit = 1.0f;
+ aluVectorSet(&listener->Position, 0.0f, 0.0f, 0.0f, 1.0f);
+ aluVectorSet(&listener->Velocity, 0.0f, 0.0f, 0.0f, 0.0f);
+ listener->Forward[0] = 0.0f;
+ listener->Forward[1] = 0.0f;
+ listener->Forward[2] = -1.0f;
+ listener->Up[0] = 0.0f;
+ listener->Up[1] = 1.0f;
+ listener->Up[2] = 0.0f;
+ aluMatrixSet(&listener->Params.Matrix,
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
);
- aluVectorSet(&Context->Listener->Params.Velocity, 0.0f, 0.0f, 0.0f, 0.0f);
+ aluVectorSet(&listener->Params.Velocity, 0.0f, 0.0f, 0.0f, 0.0f);
//Validate Context
ATOMIC_INIT(&Context->LastError, AL_NO_ERROR);