From ef835f93d5316ea8e7702c2f34260f1bc3cd19f7 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 17 Apr 2016 07:12:48 +0200 Subject: [PATCH] Change function signature for set_coords --- gfx/drivers_shader/shader_gl_cg.c | 3 +-- gfx/drivers_shader/shader_glsl.c | 3 +-- gfx/drivers_shader/shader_null.c | 5 +---- gfx/video_shader_driver.h | 4 +++- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/gfx/drivers_shader/shader_gl_cg.c b/gfx/drivers_shader/shader_gl_cg.c index f1417dbf2a..121050eef8 100644 --- a/gfx/drivers_shader/shader_gl_cg.c +++ b/gfx/drivers_shader/shader_gl_cg.c @@ -253,9 +253,8 @@ fallback: } \ } while(0) -static bool gl_cg_set_coords(void *handle_data, void *shader_data, const void *data) +static bool gl_cg_set_coords(void *handle_data, void *shader_data, const struct gfx_coords *coords) { - const struct gfx_coords *coords = (const struct gfx_coords*)data; cg_shader_data_t *cg_data = (cg_shader_data_t*)shader_data; if (!cg_data || !coords) diff --git a/gfx/drivers_shader/shader_glsl.c b/gfx/drivers_shader/shader_glsl.c index 5e7e0321f0..44df914778 100644 --- a/gfx/drivers_shader/shader_glsl.c +++ b/gfx/drivers_shader/shader_glsl.c @@ -1379,7 +1379,7 @@ fallback: size += multiplier * coords->vertices; \ } -static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const void *data) +static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const struct gfx_coords *coords) { /* Avoid hitting malloc on every single regular quad draw. */ GLfloat short_buffer[4 * (2 + 2 + 4 + 2)]; @@ -1388,7 +1388,6 @@ static bool gl_glsl_set_coords(void *handle_data, void *shader_data, const void size_t attribs_size = 0, size = 0; struct glsl_attrib *attr = NULL; const struct shader_uniforms *uni = NULL; - const struct gfx_coords *coords = (const struct gfx_coords*)data; glsl_shader_data_t *glsl = (glsl_shader_data_t*)shader_data; if (!glsl || !glsl->shader->modern || !coords) diff --git a/gfx/drivers_shader/shader_null.c b/gfx/drivers_shader/shader_null.c index 3f6c930548..29bdde3153 100644 --- a/gfx/drivers_shader/shader_null.c +++ b/gfx/drivers_shader/shader_null.c @@ -92,15 +92,12 @@ static bool shader_null_set_mvp(void *data, void *shader_data, const math_matrix return false; } -static bool shader_null_set_coords(void *handle_data, void *shader_data, const void *data) +static bool shader_null_set_coords(void *handle_data, void *shader_data, const struct gfx_coords *coords) { #ifdef HAVE_OPENGL #ifndef NO_GL_FF_VERTEX if (string_is_equal(video_driver_get_ident(), "gl")) - { - const struct gfx_coords *coords = (const struct gfx_coords*)data; gl_ff_vertex(coords); - } #endif #endif return false; diff --git a/gfx/video_shader_driver.h b/gfx/video_shader_driver.h index 8278cf366b..f599673615 100644 --- a/gfx/video_shader_driver.h +++ b/gfx/video_shader_driver.h @@ -20,6 +20,8 @@ #include +#include "video_coord_array.h" + #ifdef HAVE_CONFIG_H #include "../config.h" #endif @@ -183,7 +185,7 @@ typedef struct shader_backend void (*shader_scale)(void *data, unsigned index, struct gfx_fbo_scale *scale); bool (*set_coords)(void *handle_data, - void *shader_data, const void *data); + void *shader_data, const struct gfx_coords *coords); bool (*set_mvp)(void *data, void *shader_data, const math_matrix_4x4 *mat); unsigned (*get_prev_textures)(void *data);