Пример #1
0
void ft_display_hor(t_id *s)
{	
	int i;
	int j;
	int ct;

	j = 0;
	i = 0;
	ct = 0;
	while (j < s->nl)
	{
		i = 0;
		while (i < (s->nc - 1))
		{
			
			s->x0 = W_X/2-(s->nc/2*s->dp)+(i*s->dp);
			s->y0 = W_Y/2-(s->nl/2*s->dp)+(j*s->dp);
			s->x1 = W_X/2-(s->nc/2*s->dp)+((i+1)*s->dp);
			s->y1 = W_Y/2-(s->nl/2*s->dp)+(j*s->dp);
			ft_bresenham(s); 
			i++;
		}
		j++;
	}
}
Пример #2
0
void ft_display_ver(t_id *s)
{	
	int i;
	int j;
	int ct;

	j = 0;
	i = 0;
	ct = 0;

	while (j < (s->nl - 1))
	{
		i = 0;
		while (i < s->nc)
		{
			s->x0 = W_X/2-(s->nc/2*s->dp)+(i*s->dp)+decalx;
			s->y0 = W_Y/2-(s->nl/2*s->dp)+(j*s->dp)+decaly;
			s->x1 = W_X/2-(s->nc/2*s->dp)+(i*s->dp)+decalx;
			s->y1 = W_Y/2-(s->nl/2*s->dp)+((j+1)*s->dp)+decaly;
			ft_bresenham(s);
			i++;
		}
		j++;
	}
}
Пример #3
0
void	ft_display_hor(t_id *s)
{
	int i;
	int j;

	j = 0;
	while (j < s->nl)
	{
		i = 0;
		while (i < (s->nc - 1))
		{
			s->y0 = W_Y / 2 - (s->nl / 2 * s->dp) + (j * s->dp) + s->decaly
				- s->map[j][i] * s->decalz;
			s->y1 = W_Y / 2 - (s->nl / 2 * s->dp) + (j * s->dp) + s->decaly
				- s->map[j][i + 1] * s->decalz;
			s->x0 = W_X / 2 - (s->nc / 2 * s->dp) + (i * s->dp) + s->decalx
				+ s->slide * s->y0;
			s->x1 = W_X / 2 - (s->nc / 2 * s->dp) + ((i + 1) * s->dp)
				+ s->decalx + s->slide * s->y1;
			ft_color_horizontal(s, i, j);
			ft_bresenham(s, s->col);
			i++;
		}
		j++;
	}
}
Пример #4
0
void		ft_drawhsegment(t_xy **tab, int nbline, t_env *e)
{
	int i;
	int ii;

	ii = 0;
	while (ii < nbline)
	{
		i = 0;
		while (i < (tab[ii][i].nbst - 1))
		{
			ft_bresenham(tab[ii][i], tab[ii][i + 1], e);
			i++;
		}
		ii++;
	}
}
Пример #5
0
void		ft_drawvsegment(t_xy **tab, int nbline, t_env *e)
{
	int i;
	int ii;

	ii = 0;
	while (ii < nbline - 1)
	{
		i = 0;
		while (i < tab[ii][0].nbst && i < tab[ii + 1][0].nbst)
		{
			ft_bresenham(tab[ii][i], tab[ii + 1][i], e);
			i++;
		}
		ii++;
	}
}