From 6316876ad3c6e080d0c54fea93dd22de1449d2c7 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 2 Oct 2014 10:34:52 +0200 Subject: [PATCH] (GL) Cleanup gl_shader_set_coords --- gfx/gl.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gfx/gl.c b/gfx/gl.c index 973ca6f07f..a049356d56 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -303,13 +303,18 @@ static void gl_disable_client_arrays(gl_t *gl) } #endif -void gl_shader_set_coords(gl_t *gl, const struct gl_coords *coords, const math_matrix *mat) +void gl_shader_set_coords(gl_t *gl, + const struct gl_coords *coords, const math_matrix *mat) { - bool ret_coords = (gl->shader) ? gl->shader->set_coords(coords) : false; - bool ret_mvp = (gl->shader) ? gl->shader->set_mvp(gl, mat) : false; + gl_shader_backend_t *shader = (gl_shader_backend_t*)gl->shader; + bool ret_coords = false; + bool ret_mvp = false; - (void)ret_coords; - (void)ret_mvp; + if (shader) + { + ret_coords = shader->set_coords(coords); + ret_mvp = shader->set_mvp(gl, mat); + } #ifndef NO_GL_FF_VERTEX if (!ret_coords)