Guest User

Untitled

a guest
Jun 13th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. void fb_paintline2(Point p1, Point p2, uint16_t clr)
  2. {
  3. int i;
  4. int j;
  5. int xdiff = p2.x - p1.x;
  6. int ydiff = p2.y - p1.y;
  7. int len = 0;
  8. if(xdiff > 0)
  9. {
  10. if (ydiff > 0)
  11. {
  12. int pixelsforeachx = (p2.x-p1.x)/(p2.x-p1.x);
  13. for(i = p1.x; i < p2.x; i++)
  14. {
  15. for(j = 0; j < pixelsforeachx; j++)
  16. {}
  17. fb_plot(p1.y+len*j, i , clr);
  18. len += pixelsforeachx;
  19. //}
  20. }
  21. }
  22. }
  23. }
Add Comment
Please, Sign In to add comment