From 7daf9fae038af952f3d742098315ebf95ea48744 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 12 Feb 2015 21:58:35 +0100 Subject: [PATCH] Fix crash on startup with threaded video --- gfx/drivers/gl.c | 21 --------------------- gfx/gl_common.c | 2 +- gfx/gl_common.h | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index 5e69b6f1f5..e11210534a 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -319,27 +319,6 @@ static inline GLenum min_filter_to_mag(GLenum type) } } -static unsigned gl_wrap_type_to_enum(enum gfx_wrap_type type) -{ - switch (type) - { -#ifndef HAVE_OPENGLES - case RARCH_WRAP_BORDER: - return GL_CLAMP_TO_BORDER; -#else - case RARCH_WRAP_BORDER: -#endif - case RARCH_WRAP_EDGE: - return GL_CLAMP_TO_EDGE; - case RARCH_WRAP_REPEAT: - return GL_REPEAT; - case RARCH_WRAP_MIRRORED_REPEAT: - return GL_MIRRORED_REPEAT; - } - - return 0; -} - #ifdef HAVE_FBO static void gl_shader_scale(gl_t *gl, unsigned idx, struct gfx_fbo_scale *scale) diff --git a/gfx/gl_common.c b/gfx/gl_common.c index 8da3d7c2d4..9323d39ebe 100644 --- a/gfx/gl_common.c +++ b/gfx/gl_common.c @@ -33,7 +33,7 @@ void gl_load_texture_data(GLuint id, glBindTexture(GL_TEXTURE_2D, id); - wrap = driver.video->wrap_type_to_enum(wrap_type); + wrap = gl_wrap_type_to_enum(wrap_type); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap); diff --git a/gfx/gl_common.h b/gfx/gl_common.h index 8480aa3659..221c291f7c 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -414,4 +414,25 @@ void gl_load_texture_data(GLuint id, bool gl_load_luts(const struct video_shader *generic_shader, GLuint *lut_textures); +static INLINE unsigned gl_wrap_type_to_enum(enum gfx_wrap_type type) +{ + switch (type) + { +#ifndef HAVE_OPENGLES + case RARCH_WRAP_BORDER: + return GL_CLAMP_TO_BORDER; +#else + case RARCH_WRAP_BORDER: +#endif + case RARCH_WRAP_EDGE: + return GL_CLAMP_TO_EDGE; + case RARCH_WRAP_REPEAT: + return GL_REPEAT; + case RARCH_WRAP_MIRRORED_REPEAT: + return GL_MIRRORED_REPEAT; + } + + return 0; +} + #endif