mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(gl_raster_font) Reorder ancient/modern checks
This commit is contained in:
parent
10345e0899
commit
b1c9d48368
@ -60,13 +60,19 @@ static bool gl_raster_font_upload_atlas(gl_raster_t *font,
|
|||||||
uint8_t *tmp = NULL;
|
uint8_t *tmp = NULL;
|
||||||
struct retro_hw_render_callback *cb = video_driver_callback();
|
struct retro_hw_render_callback *cb = video_driver_callback();
|
||||||
bool ancient = false; /* add a check here if needed */
|
bool ancient = false; /* add a check here if needed */
|
||||||
|
|
||||||
#ifndef HAVE_OPENGLES
|
|
||||||
bool modern = font->gl->core_context ||
|
bool modern = font->gl->core_context ||
|
||||||
(cb->context_type == RETRO_HW_CONTEXT_OPENGL &&
|
(cb->context_type == RETRO_HW_CONTEXT_OPENGL &&
|
||||||
cb->version_major >= 3);
|
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 };
|
GLint swizzle[] = { GL_ONE, GL_ONE, GL_ONE, GL_RED };
|
||||||
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
|
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;
|
gl_format = GL_RED;
|
||||||
ncomponents = 1;
|
ncomponents = 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
if (ancient)
|
|
||||||
{
|
|
||||||
gl_internal = gl_format = GL_RGBA;
|
|
||||||
ncomponents = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = (uint8_t*)calloc(height, width * ncomponents);
|
tmp = (uint8_t*)calloc(height, width * ncomponents);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user