int main(int argc, char **argv) { int fd; t_list *ints; int width; int this_width; int check; ints = NULL; if (argc == 2) { fd = open(argv[1], O_RDONLY); if (fd < 0) fdf_error(argv[1]); check = set_next_line(&ints, fd, &width); while (((check = set_next_line(&ints, fd, &this_width)) > 0)) { if (width != this_width) { ft_putendl_fd("Invalid File Format", 2); return (1); } } mlx(ints, width); } return (0); }
int main(int ac, char **argv) { t_env env; if (ac < 2) return (0); if ((env.ptr = mlx_init()) == NULL) return (0); if ((env.win = mlx_new_window(env.ptr, SCREENWIDTH, SCREENHEIGHT , "Raycaster")) == NULL) return (0); create_img(&env); get_tex(&env); init(&env); get_map(&env.worldmap, argv[1]); mlx(&env); return (0); }