From b8b2a465d10e64aff370ca8406f65832d0f64fed Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 28 Mar 2016 18:07:18 +0200 Subject: vo_opengl: reduce temporary variables in gl_transform_trans() Using a single gl_transform variable instead of many float ones makes it easier to see what it's doing. No functional change. --- video/out/opengl/utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index f88cd4374a..287d9aee4a 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -480,11 +480,11 @@ void gl_transform_ortho(struct gl_transform *t, float x0, float x1, // process. In other words: post-composes t onto x void gl_transform_trans(struct gl_transform t, struct gl_transform *x) { - float x00 = x->m[0][0], x01 = x->m[0][1], x10 = x->m[1][0], x11 = x->m[1][1]; - x->m[0][0] = t.m[0][0] * x00 + t.m[0][1] * x10; - x->m[1][0] = t.m[1][0] * x00 + t.m[1][1] * x10; - x->m[0][1] = t.m[0][0] * x01 + t.m[0][1] * x11; - x->m[1][1] = t.m[1][0] * x01 + t.m[1][1] * x11; + struct gl_transform xt = *x; + x->m[0][0] = t.m[0][0] * xt.m[0][0] + t.m[0][1] * xt.m[1][0]; + x->m[1][0] = t.m[1][0] * xt.m[0][0] + t.m[1][1] * xt.m[1][0]; + x->m[0][1] = t.m[0][0] * xt.m[0][1] + t.m[0][1] * xt.m[1][1]; + x->m[1][1] = t.m[1][0] * xt.m[0][1] + t.m[1][1] * xt.m[1][1]; gl_transform_vec(t, &x->t[0], &x->t[1]); } -- cgit v1.2.3