From ced2be0469537a5d21043325c9bc54762197ec30 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Sat, 7 Mar 2020 20:30:07 +0100 Subject: qwe --- src/ft_draw_scene.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/ft_draw_scene.c') diff --git a/src/ft_draw_scene.c b/src/ft_draw_scene.c index f96eae6..e7895f5 100644 --- a/src/ft_draw_scene.c +++ b/src/ft_draw_scene.c @@ -21,20 +21,18 @@ static int8_t const uint32_t x = 15; const uint32_t y = clist->wlist.y_size - (clist->mlist.map_h * clist->mlist.scale) - 20; - const uint8_t len = 6 + ft_uintlen(clist->currlvl); + uint8_t len; char *str; + len = 6 + ft_uintlen(clist->currlvl); if (!(str = (char*)malloc((len + 1) * sizeof(char)))) return (-1); ft_sprintf(str, "Stage %hd", clist->currlvl); - if (clist->mlist.isnlvl) - { - mlx_string_put(clist->wlist.wlx, - clist->wlist.winptr, - x, y, - 0x00ff0000, - str); - } + mlx_string_put(clist->wlist.wlx, + clist->wlist.winptr, + x, y, + 0x00ff0000, + str); ft_memdel((void**)&str); return (0); } @@ -50,11 +48,10 @@ void if (clist->ishud) { ft_draw_hud(clist); - ft_error(FT_RET_ALLOC_ERR, FT_ERR_ALLOCATE, clist); } mlx_put_image_to_window(clist->wlist.wlx, clist->wlist.winptr, clist->img.img, 0, 0); - if (clist->ishud) + if (clist->ishud && clist->mlist.isnlvl) { if (ft_put_stage(clist) < 0) { -- cgit v1.2.3