Merge pull request #7319 from m4xw/libnx_freetype

[LIBNX] Add freetype, force freetype off on thread. Add Shaderpipeline define.
This commit is contained in:
Twinaphex 2018-09-29 11:48:11 +02:00 committed by GitHub
commit 78fea999a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -40,7 +40,7 @@ HAVE_NETWORKING = 1
# RetroArch libnx useful flags
HAVE_THREADS = 1
HAVE_PTHREADS = 1
HAVE_FREETYPE = 0
HAVE_FREETYPE = 1
HAVE_SWITCH = 1
HAVE_LIBNX = 1
HAVE_OPENGL = 1
@ -110,9 +110,9 @@ NO_ICON := 1
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -mcpu=cortex-a57+crc+fp+simd
CFLAGS := -g -Wall -O3 -ffast-math -ffunction-sections \
$(ARCH) $(DEFINES) -Ideps -Ideps/libz -Ilibretro-common/include -Ideps/stb -I$(LIBNX)/include -I$(PORTLIBS)/include/ -include $(LIBNX)/include/switch.h #$(shell $(DEVKITPRO)/portlibs/switch/bin/freetype-config --cflags)
$(ARCH) $(DEFINES) -Ideps -Ideps/libz -Ilibretro-common/include -Ideps/stb -I$(LIBNX)/include -I$(PORTLIBS)/include/ -include $(LIBNX)/include/switch.h $(shell $(DEVKITPRO)/portlibs/switch/bin/freetype-config --cflags)
CFLAGS += $(INCLUDE) -DSWITCH=1 -DHAVE_LIBNX=1 -DNXLINK=1
CFLAGS += $(INCLUDE) -DSWITCH=1 -DHAVE_LIBNX=1 -DNXLINK=1 -DHAVE_SHADERPIPELINE -DHAVE_FREETYPE
# The following line works around an issue in newlib that produces a compilation
# error in glm. It will be removed as soon as this issue is resolved.
@ -123,7 +123,7 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs $(ARCH) -Wl,--allow-multiple-definition -Wl,-Map,$(notdir $*.map)
LIBS := -lstdc++ -lbz2 -lpng -lz -lnx -lm
LIBS := -lfreetype -lstdc++ -lbz2 -lpng -lz -lnx -lm
ifeq ($(HAVE_OPENGL), 1)
LIBS := -lEGL -lglapi -ldrm_nouveau $(LIBS)

View File

@ -56,6 +56,14 @@ int font_renderer_create_default(
for (i = 0; font_backends[i]; i++)
{
const char *path = font_path;
/*
Switch libnx freetype is bugged on thread, skip
TODO: remove when fixed
*/
#if defined(HAVE_LIBNX) && defined(HAVE_FREETYPE)
if(font_backends[i] == &freetype_font_renderer && *video_driver_get_threaded()) // freetype
continue;
#endif
if (!path)
path = font_backends[i]->get_default_font();