From 32b21b050fe66c688d9b21f86197b8ac4cfaefdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 13 May 2014 18:41:37 +0200 Subject: [PATCH] do not define variables until they're needed --- src/util/mat4.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/mat4.cpp b/src/util/mat4.cpp index 44bd3edd7..e86c9e35e 100644 --- a/src/util/mat4.cpp +++ b/src/util/mat4.cpp @@ -87,16 +87,16 @@ void matrix::copy(mat4& out, const mat4& a) { } void matrix::translate(mat4& out, const mat4& a, float x, float y, float z) { - float a00, a01, a02, a03, - a10, a11, a12, a13, - a20, a21, a22, a23; - if (a == out) { out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; } else { + float a00, a01, a02, a03, + a10, a11, a12, a13, + a20, a21, a22, a23; + a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11];