poly.c (483B)
1 #include "u.h" 2 #include "lib.h" 3 #include "draw.h" 4 #include "memdraw.h" 5 #include "memlayer.h" 6 7 void 8 mempoly(Memimage *dst, Point *vert, int nvert, int end0, int end1, int radius, Memimage *src, Point sp, int op) 9 { 10 int i, e0, e1; 11 Point d; 12 13 if(nvert < 2) 14 return; 15 d = subpt(sp, vert[0]); 16 for(i=1; i<nvert; i++){ 17 e0 = e1 = Enddisc; 18 if(i == 1) 19 e0 = end0; 20 if(i == nvert-1) 21 e1 = end1; 22 memline(dst, vert[i-1], vert[i], e0, e1, radius, src, addpt(d, vert[i-1]), op); 23 } 24 }