added gradient shader logic to trapezoids

This commit is contained in:
2026-07-08 14:34:55 -07:00
parent b7032c3b8e
commit f61e3a8237
8 changed files with 70 additions and 54 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ namespace UwU {
int16_t d = (2 * dy) - dx;
int16_t y = iy0;
for (int16_t x = ix0; x < ix1; x++) {
buffer.drawPixel(Coord2((uint16_t)x, (uint16_t)y), color);
buffer.drawPixel((uint16_t)x, (uint16_t)y, color);
if (d > 0) {
y += yi;
d += (2 * (dy - dx));
@@ -45,7 +45,7 @@ namespace UwU {
int16_t d = (2 * dx) - dy;
int16_t x = ix0;
for (int16_t y = iy0; y < iy1; y++) {
buffer.drawPixel(Coord2((uint16_t)x, (uint16_t)y), color);
buffer.drawPixel((uint16_t)x, (uint16_t)y, color);
if (d > 0) {
x += xi;
d += (2 * (dx - dy));