From 4adfaa07fcf25a48825a02dea275d9a735df72aa Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Oct 2020 14:16:12 +0200 Subject: [PATCH] Cleanups --- gfx/gfx_display.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gfx/gfx_display.c b/gfx/gfx_display.c index 49579d19e7..12a9c219de 100644 --- a/gfx/gfx_display.c +++ b/gfx/gfx_display.c @@ -1201,6 +1201,9 @@ void gfx_display_draw_cursor( gfx_display_t *p_disp = disp_get_ptr(); gfx_display_ctx_driver_t *dispctx = p_disp->dispctx; + if (!dispctx) + return; + coords.vertices = 4; coords.vertex = NULL; coords.tex_coord = NULL; @@ -1217,15 +1220,12 @@ void gfx_display_draw_cursor( draw.prim_type = GFX_DISPLAY_PRIM_TRIANGLESTRIP; draw.pipeline_id = 0; - if (dispctx) - { - if (dispctx->blend_begin) - dispctx->blend_begin(userdata); - if (dispctx->draw) - dispctx->draw(&draw, userdata, video_width, video_height); - if (dispctx->blend_end) - dispctx->blend_end(userdata); - } + if (dispctx->blend_begin) + dispctx->blend_begin(userdata); + if (dispctx->draw) + dispctx->draw(&draw, userdata, video_width, video_height); + if (dispctx->blend_end) + dispctx->blend_end(userdata); } void gfx_display_push_quad(