Beispiel #1
0
static void		ft_draw_wall(t_mlx *mx, int y, int pixel)
{
	if (mx->map.data[mx->v.map.x][mx->v.map.y] > 2 && mx->b & 2)
		ft_apply_texture(&mx->map, &mx->v, mx->height, y);
	else
		ft_set_color(&mx->v);
	ft_put_pixel(&mx->v, mx->data, pixel, WALL);
}
Beispiel #2
0
void	ft_preset_map(t_map *map)
{
	ft_calc_zoom_and_dim(map);
	map->z_eye = 1000;
	map->dif_eye_win = map->z_eye - map->z_eye / 4;
	map->height = 10;
	map->trans.x = 0;
	if (map->perspective == 0)
		map->trans.y = 0;
	else
		map->trans.y = map->lines * map->zoom;
	map->axis[0].axis = 'x';
	map->axis[1].axis = 'y';
	map->axis[2].axis = 'z';
	map->axis[0].value = 50;
	map->axis[1].value = 20;
	map->axis[2].value = 30;
	map->eye.x = 0;
	map->eye.y = 0;
	map->eye.h = map->z_eye;
	map->win_h = map->z_eye - map->dif_eye_win;
	map->color = ft_set_color(255, 255, 255);
}