7 void triangle(int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t c)
10 line(x0, y0, x1, y1, c);
11 line(x1, y1, x2, y2, c);
12 line(x2, y2, x0, y0, c);
16 void triangleFilled(int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t c)
23 screen_swap(y0, y1); screen_swap(x0, x1);
26 screen_swap(y2, y1); screen_swap(x2, x1);
29 screen_swap(y0, y1); screen_swap(x0, x1);
35 else if (x1 > b) b = x1;
37 else if (x2 > b) b = x2;
38 line(a, y0, b, y0, c);
58 if (y1 == y2) last = y1;
61 for (y = y0; y <= last; y++) {
67 if (a > b) screen_swap(a, b);
75 for (; y <= y2; y++) {
81 if (a > b) screen_swap(a, b);