Beispiel #1
0
int		main(int argc, char **argv)
{
	int		***tab;
	t_conf	conf;
	t_data	d;

	if (argc != 2)
	{
		ft_putstr("usage: ./fdf [data_file]");
		return (0);
	}
	tab = ft_get_data(argv, &conf);
	d.map = tab;
	d.wall = conf.wall;
	d.col = conf.x;
	d.li = conf.y;
	d.empty = conf.empty;
	d.p = (t_point *)malloc(sizeof(t_point));
	d.p->x = 1040;
	d.p->y = 1104;
	d.alpha = 0;
	ft_init_attr(&d);
	ft_print_map(d.map);
	ft_mlx(&d);
	return (0);
}
Beispiel #2
0
int		main(int ac, char **av)
{
	t_env *e;

	(void)ac;
	(void)av;
	if ((e = (t_env *)malloc(sizeof(t_env))) == NULL)
		exit(0);
	ft_mlx(e);
	return (0);
}
Beispiel #3
0
int		main(int ac, char **av)
{
	int		***map;
	t_map	info;
	t_data	d;

	if ((map = ft_get_map(ac, av, &info)))
	{
		d.map = map;
		d.info = &info;
		d.bgfill = 0;
		ft_mlx(&d);
	}
	return (0);
}
Beispiel #4
0
int			main(int ac, char **av)
{
	t_map *map;
	t_env *c;

	if (ac == 1)
		exit(0);
	c = (t_env *)malloc(sizeof(t_env));
	map = (t_map *)malloc(sizeof(t_map));
	c->off = XCENTER;
	c->off2 = YCENTER;
	c->zoom = 42;
	c->zh = 1;
	c->rot = 0;
	c->roty = M_PI / 2;
	map->av = av;
	c->coord = ft_get_coord(map);
	ft_mlx(c);
	return (0);
}
Beispiel #5
0
int			main(int argc, char **argv)
{
	int		fd;
	char	*map;

	if (argc != 2 || ft_atoi(argv[1]) > 4 || ft_atoi(argv[1]) < 0)
	{
		ft_putstr_fd("usage : ./wolf3d \"number of the map\"\n", 2);
		return (-1);
	}
	map = ft_strjoin("map/map", argv[1]);
	fd = open(map, O_RDONLY);
	if (fd == -1)
	{
		ft_putstr_fd(strerror(errno), 2);
		return (-1);
	}
	ft_mlx(fd);
	close(fd);
	return (0);
}
Beispiel #6
0
Datei: main.c Projekt: Krboo/fdf
int		main(int ac, char **av)
{
	t_map *map;
	t_env *e;

	if (ac != 2 || ft_strcmp(av[1], "/dev/null") == 0 || \
	ft_strncmp(av[1], "/dev", 4) == 0)
		str_exit("Usage : ./fdf <mapfile.fdf>");
	e = (t_env *)malloc(sizeof(t_env));
	map = (t_map *)malloc(sizeof(t_map));
	e->off = XCENTER;
	e->off2 = YCENTER;
	e->zoom = 42;
	e->zh = 1;
	e->rot = 0;
	e->roty = M_PI / 2;
	map->av = av;
	e->coord = ft_get_coord(map);
	ft_mlx(e);
	free_all(e, map);
	return (0);
}
Beispiel #7
0
void		ft_open_win(t_env *e, char *map)
{
	struct_init(e);
	parse(map, e);
	ft_mlx(e);
}