From 6a3386ad1aecbaee5d490cc18219d38a6dd9308a Mon Sep 17 00:00:00 2001 From: Themaister Date: Mon, 23 May 2011 11:45:44 +0200 Subject: [PATCH] Should fix stupid SDL message rendering bug when no font is set. --- gfx/sdl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gfx/sdl.c b/gfx/sdl.c index d69f0b8419..c7a4fc2e33 100644 --- a/gfx/sdl.c +++ b/gfx/sdl.c @@ -92,6 +92,9 @@ static void sdl_init_font(sdl_video_t *vid, const char *font_path, unsigned font static void sdl_render_msg_15(sdl_video_t *vid, SDL_Surface *buffer, const char *msg, unsigned width, unsigned height, const SDL_PixelFormat *fmt) { #ifdef HAVE_FREETYPE + if (!vid->font) + return; + struct font_output_list out; font_renderer_msg(vid->font, msg, &out); struct font_output *head = out.head; @@ -150,6 +153,9 @@ static void sdl_render_msg_15(sdl_video_t *vid, SDL_Surface *buffer, const char static void sdl_render_msg_32(sdl_video_t *vid, SDL_Surface *buffer, const char *msg, unsigned width, unsigned height, const SDL_PixelFormat *fmt) { #ifdef HAVE_FREETYPE + if (!vid->font) + return; + struct font_output_list out; font_renderer_msg(vid->font, msg, &out); struct font_output *head = out.head;