diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_draw_scene.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/ft_draw_scene.c b/src/ft_draw_scene.c index 1edef2a..86009f6 100644 --- a/src/ft_draw_scene.c +++ b/src/ft_draw_scene.c @@ -13,8 +13,19 @@ #include <libft.h> #include <cub3d.h> #include <mlx.h> +#include <stdlib.h> #include <stdint.h> +static void + ft_put_fps(t_cub *clist) +{ + mlx_string_put(clist->wlist.wlx, + clist->wlist.winptr, + 10, 20, + 0x00eeeeee, + clist->fps_count); +} + static int8_t ft_put_stage(t_cub *clist) { @@ -34,7 +45,7 @@ static int8_t (uint32_t)x, y, 0x002288da, str); - ft_memdel((void**)&str); + ft_memdel((void*)&str); return (0); } @@ -60,9 +71,12 @@ void clist->wlist.winptr, clist->img.img, 0, 0); if (FT_OS == 2) mlx_destroy_image(clist->wlist.wlx, clist->img.img); - if (clist->ishud && clist->mlist.isnlvl) - if (ft_put_stage(clist) < 0) + if (clist->ishud) + { + ft_put_fps(clist); + if (clist->mlist.isnlvl && ft_put_stage(clist) < 0) ft_error(FT_RET_ALLOC_ERR, FT_ERR_ALLOCATE, clist); + } } void |