Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void fb_paintline2(Point p1, Point p2, uint16_t clr)
- {
- int i;
- int j;
- int xdiff = p2.x - p1.x;
- int ydiff = p2.y - p1.y;
- int len = 0;
- if(xdiff > 0)
- {
- if (ydiff > 0)
- {
- int pixelsforeachy = (p2.y-p1.y)/(p2.x-p1.x);
- for(i = p1.x; i < p2.x; i++)
- {
- for(j = 0; j < pixelsforeachy; i++)
- {
- fb_plot(i, p1.y+j, clr);
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment