aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_scene.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-03-07 20:30:07 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-03-07 20:30:07 +0100
commitced2be0469537a5d21043325c9bc54762197ec30 (patch)
tree0147b95e157bec2b301e82badc1532d40335201b /src/ft_draw_scene.c
parentThe sky is nice (diff)
download42-cub3d-ced2be0469537a5d21043325c9bc54762197ec30.tar.gz
42-cub3d-ced2be0469537a5d21043325c9bc54762197ec30.tar.bz2
42-cub3d-ced2be0469537a5d21043325c9bc54762197ec30.tar.xz
42-cub3d-ced2be0469537a5d21043325c9bc54762197ec30.tar.zst
42-cub3d-ced2be0469537a5d21043325c9bc54762197ec30.zip
qwe
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)
{