Exemplo n.º 1
0
int	draw_line(int x1, int y1, int x2, int y2, t_ptr *ptr)
{
  if (ABS((x2 - x1)) > ABS((y2 - y1)))
    draw_line_horizontal(x1, y1, x2, y2, ptr);
  if (ABS((x2 - x1)) <= ABS((y2 - y1)))
    draw_line_vertical(x1, y1, x2, y2, ptr);
}
Exemplo n.º 2
0
void  draw_line(lApp *app, lSurface *surface, int ax, int ay, int bx, int by, int color)
{
	if (abs((bx - ax)) < abs((by - ay)))
		draw_line_vertical(app, surface, ax, ay, bx, by, color);
	else
		draw_line_horizontal(app, surface, ax, ay, bx, by, color);
}