aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_scene.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_draw_scene.c')
-rw-r--r--src/ft_draw_scene.c19
1 files changed, 8 insertions, 11 deletions
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)
{