From beca1c44f37186157d1b2c832913144f0a5a6125 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 15 Dec 2012 00:27:30 +0100 Subject: [PATCH] Move all font stuff to gfx/fonts. Rename stuff so griffin doesn't break. --- Makefile | 2 +- Makefile.win | 2 +- gfx/fonts/fonts.c | 14 +++++++------- gfx/{ => fonts}/gl_font.c | 10 +++++----- gfx/{ => fonts}/gl_font.h | 2 +- gfx/gl.c | 1 - gfx/gl_common.h | 2 +- 7 files changed, 16 insertions(+), 17 deletions(-) rename gfx/{ => fonts}/gl_font.c (78%) rename gfx/{ => fonts}/gl_font.h (97%) diff --git a/Makefile b/Makefile index de2fd030cc..125718afd5 100644 --- a/Makefile +++ b/Makefile @@ -162,7 +162,7 @@ ifeq ($(HAVE_SDL), 1) endif ifeq ($(HAVE_OPENGL), 1) - OBJ += gfx/gl.o gfx/gfx_context.o gfx/gl_font.o gfx/fonts/gl_raster_font.o gfx/math/matrix.o + OBJ += gfx/gl.o gfx/gfx_context.o gfx/fonts/gl_font.o gfx/fonts/gl_raster_font.o gfx/math/matrix.o ifeq ($(HAVE_KMS), 1) OBJ += gfx/context/drm_egl_ctx.o diff --git a/Makefile.win b/Makefile.win index c90d9c5ea5..bf2fbb4001 100644 --- a/Makefile.win +++ b/Makefile.win @@ -102,7 +102,7 @@ ifeq ($(HAVE_THREADS), 1) endif ifeq ($(HAVE_OPENGL), 1) - OBJ += gfx/gl.o gfx/math/matrix.o gfx/gl_font.o gfx/fonts/gl_raster_font.o gfx/gfx_context.o gfx/context/wgl_ctx.o + OBJ += gfx/gl.o gfx/math/matrix.o gfx/fonts/gl_font.o gfx/fonts/gl_raster_font.o gfx/gfx_context.o gfx/context/wgl_ctx.o DEFINES += -DHAVE_OPENGL LIBS += -lopengl32 -lgdi32 endif diff --git a/gfx/fonts/fonts.c b/gfx/fonts/fonts.c index 7c6bf48edb..1d3c4e3223 100644 --- a/gfx/fonts/fonts.c +++ b/gfx/fonts/fonts.c @@ -20,7 +20,7 @@ #include "../../config.h" #endif -static const font_renderer_driver_t *backends[] = { +static const font_renderer_driver_t *font_backends[] = { #ifdef HAVE_FREETYPE &ft_font_renderer, #endif @@ -32,24 +32,24 @@ static const font_renderer_driver_t *backends[] = { bool font_renderer_create_default(const font_renderer_driver_t **driver, void **handle) { - for (unsigned i = 0; i < ARRAY_SIZE(backends); i++) + for (unsigned i = 0; i < ARRAY_SIZE(font_backends); i++) { const char *font_path = *g_settings.video.font_path ? g_settings.video.font_path : NULL; if (!font_path) - font_path = backends[i]->get_default_font(); + font_path = font_backends[i]->get_default_font(); if (!font_path) continue; - *handle = backends[i]->init(font_path, g_settings.video.font_size); + *handle = font_backends[i]->init(font_path, g_settings.video.font_size); if (*handle) { - RARCH_LOG("Using font rendering backend: %s.\n", backends[i]->ident); - *driver = backends[i]; + RARCH_LOG("Using font rendering backend: %s.\n", font_backends[i]->ident); + *driver = font_backends[i]; return true; } else - RARCH_ERR("Failed to create rendering backend: %s.\n", backends[i]->ident); + RARCH_ERR("Failed to create rendering backend: %s.\n", font_backends[i]->ident); } *driver = NULL; diff --git a/gfx/gl_font.c b/gfx/fonts/gl_font.c similarity index 78% rename from gfx/gl_font.c rename to gfx/fonts/gl_font.c index 31a42c3042..1cadc03c34 100644 --- a/gfx/gl_font.c +++ b/gfx/fonts/gl_font.c @@ -14,18 +14,18 @@ */ #include "gl_font.h" -#include "../general.h" +#include "../../general.h" -static const gl_font_renderer_t *backends[] = { +static const gl_font_renderer_t *gl_font_backends[] = { &gl_raster_font, }; const gl_font_renderer_t *gl_font_init_first(void *data, const char *font_path, unsigned font_size) { - for (unsigned i = 0; i < ARRAY_SIZE(backends); i++) + for (unsigned i = 0; i < ARRAY_SIZE(gl_font_backends); i++) { - if (backends[i]->init(data, font_path, font_size)) - return backends[i]; + if (gl_font_backends[i]->init(data, font_path, font_size)) + return gl_font_backends[i]; } return NULL; diff --git a/gfx/gl_font.h b/gfx/fonts/gl_font.h similarity index 97% rename from gfx/gl_font.h rename to gfx/fonts/gl_font.h index 0fb4b0794a..ab58d677ec 100644 --- a/gfx/gl_font.h +++ b/gfx/fonts/gl_font.h @@ -17,7 +17,7 @@ #define GL_FONT_H__ #include -#include "../boolean.h" +#include "../../boolean.h" typedef struct gl_font_renderer { diff --git a/gfx/gl.c b/gfx/gl.c index 861ab0af01..239d29f72e 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -34,7 +34,6 @@ #endif #include "gl_common.h" -#include "gl_font.h" #include "gfx_common.h" #include "gfx_context.h" #include "../compat/strl.h" diff --git a/gfx/gl_common.h b/gfx/gl_common.h index 9e514bc0f1..621ce50c71 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -21,7 +21,7 @@ #include "math/matrix.h" #include "gfx_context.h" #include "scaler/scaler.h" -#include "gl_font.h" +#include "fonts/gl_font.h" #ifdef HAVE_CONFIG_H #include "../config.h"