Prevent stb_truetype from being included twice for Griffin

This commit is contained in:
twinaphex 2016-11-05 20:45:23 +01:00
parent a092f4d383
commit 37ff8cb66f
4 changed files with 5 additions and 6 deletions

View File

@ -553,6 +553,7 @@ endif
ifeq ($(HAVE_STB_FONT), 1)
OBJ += gfx/drivers_font_renderer/stb.o
OBJ += gfx/drivers_font_renderer/stb_unicode.o
endif
ifeq ($(HAVE_FREETYPE), 1)

View File

@ -23,6 +23,7 @@
#include "../font_driver.h"
#include "../../verbosity.h"
#ifndef STB_TRUETYPE_IMPLEMENTATION
#define STB_TRUETYPE_IMPLEMENTATION
#define STB_RECT_PACK_IMPLEMENTATION
#define STBTT_STATIC
@ -30,6 +31,7 @@
#include "../../deps/stb/stb_rect_pack.h"
#include "../../deps/stb/stb_truetype.h"
#undef static
#endif
typedef struct
{

View File

@ -23,6 +23,7 @@
#include "../font_driver.h"
#include "../../verbosity.h"
#ifndef STB_TRUETYPE_IMPLEMENTATION
#define STB_TRUETYPE_IMPLEMENTATION
#define STB_RECT_PACK_IMPLEMENTATION
#define STBRP_STATIC
@ -31,6 +32,7 @@
#include "../../deps/stb/stb_rect_pack.h"
#include "../../deps/stb/stb_truetype.h"
#undef static
#endif
typedef struct
{
@ -118,8 +120,6 @@ static uint32_t font_renderer_stb_unicode_update_atlas(stb_unicode_font_renderer
glyph->draw_offset_y = - y1 * self->scale_factor;
glyph->width = self->max_glyph_width;
glyph->height = self->max_glyph_height;
// glyph->width = (x1 + x0 ) * self->scale_factor;
// glyph->height = (y1 - y0 ) * self->scale_factor;
return id;
}
@ -203,7 +203,6 @@ static void *font_renderer_stb_unicode_init(const char *font_path, float font_si
else
self->scale_factor = stbtt_ScaleForPixelHeight(&self->info, font_size);
// self->line_height = (ascent - descent + line_gap) * self->scale_factor;
self->line_height = (ascent - descent) * self->scale_factor;
if (!font_renderer_stb_unicode_create_atlas(self, font_size))

View File

@ -354,12 +354,9 @@ FONTS
#include "../gfx/font_driver.c"
#if defined(HAVE_STB_FONT)
#if defined(VITA) || defined(ANDROID) || defined(_WIN32) && !defined(_XBOX)
#include "../gfx/drivers_font_renderer/stb_unicode.c"
#else
#include "../gfx/drivers_font_renderer/stb.c"
#endif
#endif
#if defined(HAVE_FREETYPE)
#include "../gfx/drivers_font_renderer/freetype.c"