aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-25 22:32:30 -0800
committerChris Robinson <[email protected]>2018-12-25 22:32:30 -0800
commit38537a35ccc2ad713a31943bb699d013b004d075 (patch)
treea1999da267f11a95e87ef7bf8bf9451e58f9f55d /Alc
parentb2665a503f024ae78f004443bd853198322daa79 (diff)
Avoid using a local for a temporary
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alu.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index 96d73d1a..fec574d8 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -348,11 +348,11 @@ bool CalcListenerParams(ALCcontext *Context)
0.0f, 0.0f, 0.0f, 1.0f
};
- alu::Vector P{props->Position[0], props->Position[1], props->Position[2], 1.0f};
- P = Listener.Params.Matrix * P;
+ const alu::Vector P{Listener.Params.Matrix *
+ alu::Vector{props->Position[0], props->Position[1], props->Position[2], 1.0f}};
Listener.Params.Matrix.setRow(3, -P[0], -P[1], -P[2], 1.0f);
- alu::Vector vel{props->Velocity[0], props->Velocity[1], props->Velocity[2], 0.0f};
+ const alu::Vector vel{props->Velocity[0], props->Velocity[1], props->Velocity[2], 0.0f};
Listener.Params.Velocity = Listener.Params.Matrix * vel;
Listener.Params.Gain = props->Gain * Context->GainBoost;