From ef4337092708aa8e1c303abf582a9bab993751bd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 24 Sep 2015 10:18:29 -0700 Subject: Use a local var instead of multiple double-dereferencing --- Alc/ALc.c | 25 +++++++++++++------------ 1 file 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); -- cgit v1.2.3