Move min_filter_to_mag to gl_common.h

This commit is contained in:
twinaphex 2018-05-13 14:24:49 +02:00
parent c88a7545a3
commit 5bde17025a
3 changed files with 18 additions and 20 deletions

View File

@ -370,6 +370,21 @@ void gl_load_texture_data(
unsigned width, unsigned height,
const void *frame, unsigned base_size);
static INLINE GLenum gl_min_filter_to_mag(GLenum type)
{
switch (type)
{
case GL_LINEAR_MIPMAP_LINEAR:
return GL_LINEAR;
case GL_NEAREST_MIPMAP_NEAREST:
return GL_NEAREST;
default:
break;
}
return type;
}
RETRO_END_DECLS
#endif

View File

@ -427,21 +427,6 @@ static bool gl_shader_init(gl_t *gl, const gfx_ctx_driver_t *ctx_driver,
return video_shader_driver_init(&init_data);
}
GLenum min_filter_to_mag(GLenum type)
{
switch (type)
{
case GL_LINEAR_MIPMAP_LINEAR:
return GL_LINEAR;
case GL_NEAREST_MIPMAP_NEAREST:
return GL_NEAREST;
default:
break;
}
return type;
}
static uintptr_t gl_get_current_framebuffer(void *data)
{
gl_t *gl = (gl_t*)data;
@ -1943,7 +1928,7 @@ static void *gl_init(const video_info_t *video,
(video->smooth ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST)
: (video->smooth ? GL_LINEAR : GL_NEAREST);
gl->tex_mag_filter = min_filter_to_mag(gl->tex_min_filter);
gl->tex_mag_filter = gl_min_filter_to_mag(gl->tex_min_filter);
wrap_info.idx = 1;
@ -2102,7 +2087,7 @@ static void gl_update_tex_filter_frame(gl_t *gl)
return;
gl->tex_min_filter = new_filt;
gl->tex_mag_filter = min_filter_to_mag(gl->tex_min_filter);
gl->tex_mag_filter = gl_min_filter_to_mag(gl->tex_min_filter);
gl->wrap_mode = wrap_mode;
for (i = 0; i < gl->textures; i++)

View File

@ -166,8 +166,6 @@ static void gl2_renderchain_bind_backbuffer(void *data,
void context_bind_hw_render(bool enable);
GLenum min_filter_to_mag(GLenum type);
void gl_load_texture_data(
uint32_t id_data,
enum gfx_wrap_type wrap_type,
@ -629,7 +627,7 @@ static void gl_create_fbo_texture(gl_t *gl,
: (smooth ? GL_LINEAR : GL_NEAREST);
}
mag_filter = min_filter_to_mag(min_filter);
mag_filter = gl_min_filter_to_mag(min_filter);
wrap.idx = i + 2;
video_shader_driver_wrap_type(&wrap);