diff --git a/gfx/drivers_font/gl1_raster_font.c b/gfx/drivers_font/gl1_raster_font.c index 03dc716cc1..faad0785e0 100644 --- a/gfx/drivers_font/gl1_raster_font.c +++ b/gfx/drivers_font/gl1_raster_font.c @@ -78,41 +78,6 @@ static void gl1_raster_font_free(void *data, free(font); } -#if 0 -static bool gl1_raster_font_upload_atlas(gl1_raster_t *font) -{ - unsigned i, j; - GLint gl_internal = GL_RGBA; - GLenum gl_format = GL_RGBA; - size_t ncomponents = 4; - uint8_t *tmp = NULL; - - tmp = (uint8_t*)calloc(font->tex_height, font->tex_width * ncomponents); - - for (i = 0; i < font->atlas->height; ++i) - { - const uint8_t *src = &font->atlas->buffer[i * font->atlas->width]; - uint8_t *dst = &tmp[i * font->tex_width * ncomponents]; - - for (j = 0; j < font->atlas->width; ++j) - { - *dst++ = 0xff; - *dst++ = 0xff; - *dst++ = 0xff; - *dst++ = *src++; - } - break; - } - - glTexImage2D(GL_TEXTURE_2D, 0, gl_internal, font->tex_width, font->tex_height, - 0, gl_format, GL_UNSIGNED_BYTE, tmp); - - free(tmp); - - return true; -} -#endif - static bool gl1_raster_font_upload_atlas(gl1_raster_t *font) { unsigned i, j; @@ -172,13 +137,10 @@ static void *gl1_raster_font_init(void *data, &font->font_driver, &font->font_data, font_path, font_size)) { - RARCH_WARN("Couldn't initialize font renderer.\n"); free(font); return NULL; } - RARCH_LOG("[Font]: Using font driver GL1\n"); - if (is_threaded) if ( font->gl && diff --git a/gfx/drivers_font/gl2_raster_font.c b/gfx/drivers_font/gl2_raster_font.c index d50de48dd3..7ff7dfe869 100644 --- a/gfx/drivers_font/gl2_raster_font.c +++ b/gfx/drivers_font/gl2_raster_font.c @@ -83,65 +83,13 @@ static void gl2_raster_font_free(void *data, free(font); } -#if 0 -static bool gl2_raster_font_upload_atlas_components_4(gl2_raster_t *font) -{ - unsigned i, j; - GLint gl_internal = GL_RGBA; - GLenum gl_format = GL_RGBA; - size_t ncomponents = 4; - uint8_t *tmp = (uint8_t*) - calloc(font->tex_height, font->tex_width * ncomponents); - - for (i = 0; i < font->atlas->height; ++i) - { - const uint8_t *src = &font->atlas->buffer[i * font->atlas->width]; - uint8_t *dst = &tmp[i * font->tex_width * ncomponents]; - - for (j = 0; j < font->atlas->width; ++j) - { - *dst++ = 0xff; - *dst++ = 0xff; - *dst++ = 0xff; - *dst++ = *src++; - } - break; - } - - glTexImage2D(GL_TEXTURE_2D, 0, gl_internal, - font->tex_width, font->tex_height, - 0, gl_format, GL_UNSIGNED_BYTE, tmp); - - free(tmp); - - return true; -} -#endif - static bool gl2_raster_font_upload_atlas(gl2_raster_t *font) { unsigned i, j; - GLint gl_internal = GL_LUMINANCE_ALPHA; - GLenum gl_format = GL_LUMINANCE_ALPHA; - size_t ncomponents = 2; - uint8_t *tmp = NULL; -#if defined(GL_VERSION_3_0) - struct retro_hw_render_callback *hwr = video_driver_get_hw_context(); - - if ((font->gl && font->gl->core_context_in_use) || - (hwr->context_type == RETRO_HW_CONTEXT_OPENGL && - hwr->version_major >= 3)) - { - GLint swizzle[] = { GL_ONE, GL_ONE, GL_ONE, GL_RED }; - glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle); - - gl_internal = GL_R8; - gl_format = GL_RED; - ncomponents = 1; - } -#endif - - tmp = (uint8_t*)calloc(font->tex_height, font->tex_width * ncomponents); + GLint gl_internal = GL_LUMINANCE_ALPHA; + GLenum gl_format = GL_LUMINANCE_ALPHA; + size_t ncomponents = 2; + uint8_t *tmp = (uint8_t*)calloc(font->tex_height, font->tex_width * ncomponents); switch (ncomponents) { @@ -193,7 +141,6 @@ static void *gl2_raster_font_init(void *data, &font->font_driver, &font->font_data, font_path, font_size)) { - RARCH_WARN("Couldn't initialize font renderer.\n"); free(font); return NULL; }