/* ************************************************************************** */ /* LE - / */ /* / */ /* main.c .:: .:/ . .:: */ /* +:+:+ +: +: +:+:+ */ /* By: rbousset +:+ +: +: +:+ */ /* #+# #+ #+ #+# */ /* Created: 2020/02/02 17:19:34 by rbousset #+# ## ## #+# */ /* Updated: 2020/02/02 17:19:34 by rbousset ### #+. /#+ ###.fr */ /* / */ /* / */ /* ************************************************************************** */ #include #include #include #include int main(int argc, const char *argv[]) { t_cub *clist; (void)argv; if (argc < 2) { ft_dprintf(STDERR_FILENO, "Error\n\033[1;31mNo map selected\n\033[0m"); return (1); } if (!(clist = ft_init_cub())) { ft_memdel((void**)&clist); return (2); } if (!(clist->wlist = ft_init_win())) { ft_memdel((void**)&clist->wlist); ft_memdel((void**)&clist); return (2); } ft_print_list(clist); ft_parse_map(argv[1], clist); if (ft_init_winlx(clist) < 0) return (ft_exit(3, clist)); mlx_key_hook(clist->wlist->winptr, ft_key_event, clist); ft_drawmap(clist); mlx_loop(clist->wlist->wlx); return (0); }