(gl_raster_font) Reorder ancient/modern checks

This commit is contained in:
Higor Eurípedes 2015-07-19 13:01:28 -03:00
parent 10345e0899
commit b1c9d48368

View File

@ -60,13 +60,19 @@ static bool gl_raster_font_upload_atlas(gl_raster_t *font,
uint8_t *tmp = NULL;
struct retro_hw_render_callback *cb = video_driver_callback();
bool ancient = false; /* add a check here if needed */
#ifndef HAVE_OPENGLES
bool modern = font->gl->core_context ||
(cb->context_type == RETRO_HW_CONTEXT_OPENGL &&
cb->version_major >= 3);
if (modern)
if (ancient)
{
gl_internal = gl_format = GL_RGBA;
ncomponents = 4;
}
#ifdef HAVE_OPENGLES
(void)modern;
#else
else if (modern)
{
GLint swizzle[] = { GL_ONE, GL_ONE, GL_ONE, GL_RED };
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
@ -75,13 +81,7 @@ static bool gl_raster_font_upload_atlas(gl_raster_t *font,
gl_format = GL_RED;
ncomponents = 1;
}
else
#endif
if (ancient)
{
gl_internal = gl_format = GL_RGBA;
ncomponents = 4;
}
tmp = (uint8_t*)calloc(height, width * ncomponents);