mirror of
https://github.com/pevans/erc-c.git
synced 2025-01-17 19:30:13 +00:00
Don't attempt to render a glyph if render is NULL
This commit is contained in:
parent
ef13fe4ef1
commit
9215600148
@ -118,9 +118,13 @@ vm_bitfont_render(vm_bitfont *font,
|
|||||||
MAKE_SDL_RECT(dest_rect, *dest);
|
MAKE_SDL_RECT(dest_rect, *dest);
|
||||||
MAKE_SDL_RECT(src_rect, src);
|
MAKE_SDL_RECT(src_rect, src);
|
||||||
|
|
||||||
if (SDL_RenderCopy(screen->render, font->texture, &src_rect, &dest_rect) < 0) {
|
if (screen->render) {
|
||||||
log_critical("Failed to render glyph: %s", SDL_GetError());
|
if (SDL_RenderCopy(screen->render, font->texture,
|
||||||
return ERR_GFXOP;
|
&src_rect, &dest_rect) < 0
|
||||||
|
) {
|
||||||
|
log_critical("Failed to render glyph: %s", SDL_GetError());
|
||||||
|
return ERR_GFXOP;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
screen->dirty = true;
|
screen->dirty = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user