Skip to content

Commit

Permalink
Include which character was involved in the error message for failure…
Browse files Browse the repository at this point in the history
…s in TTF_RenderGlyph_Blended() when building the font cache.
  • Loading branch information
backwardsEric authored and NickMcConnell committed Sep 11, 2021
1 parent 4cd2d62 commit eec15fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main-sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4221,8 +4221,10 @@ static void make_font_cache(const struct window *window, struct font *font)
SDL_Surface *surface = TTF_RenderGlyph_Blended(font->ttf.handle,
(Uint16) g_ascii_codepoints_for_cache[i], white);
if (surface == NULL) {
quit_fmt("cannot render surface for cache in font '%s': %s",
font->name, TTF_GetError());
quit_fmt("font cache rendering failed for '%c'"
" (ASCII %lu) in font '%s': %s",
g_ascii_codepoints_for_cache[i],
(unsigned long) i, font->name, TTF_GetError());
}

SDL_Texture *texture = SDL_CreateTextureFromSurface(window->renderer, surface);
Expand Down

0 comments on commit eec15fc

Please sign in to comment.