look at the unshifted d values

This commit is contained in:
Amy Bowersox 2019-12-10 14:01:36 -07:00
parent 3b7f326768
commit 85144de58f
1 changed files with 4 additions and 4 deletions

View File

@ -60,28 +60,28 @@ static BOOL line_clip(PINT32 output, INT32 x1, INT32 y1, INT32 x2, INT32 y2, INT
tmp = (x2 - x1) * ((ymin - y1) / (y2 - y1));
x1 += tmp;
y1 = ymin;
Log(LDEBUG, "clipped against top to point (%d, %d), dx=%d", x1 >> 16, y1 >> 16, tmp >> 16);
Log(LDEBUG, "clipped against top to point (%d, %d), dx=%d/%d", x1 >> 16, y1 >> 16, tmp >> 16, tmp);
}
else if (outcode1 & 0x4)
{
tmp = (x2 - x1) * ((ymax - y1) / (y2 - y1));
x1 += tmp;
y1 = ymax;
Log(LDEBUG, "clipped against bottom to point (%d, %d), dx=%d", x1 >> 16, y1 >> 16, tmp >> 16);
Log(LDEBUG, "clipped against bottom to point (%d, %d), dx=%d/%d", x1 >> 16, y1 >> 16, tmp >> 16, tmp);
}
else if (outcode1 & 0x2)
{
tmp = (y2 - y1) * ((xmax - x1) / (x2 - x1));
y1 -= tmp;
x1 = xmax;
Log(LDEBUG, "clipped against right to point (%d, %d), dy=%d", x1 >> 16, y1 >> 16, tmp >> 16);
Log(LDEBUG, "clipped against right to point (%d, %d), dy=%d/%d", x1 >> 16, y1 >> 16, tmp >> 16, tmp);
}
else if (outcode1 & 0x1)
{
tmp = (y2 - y1) * ((xmin - x1) / (x2 - x1));
y1 -= tmp;
x1 = xmin;
Log(LDEBUG, "clipped against left to point (%d, %d), dy=%d", x1 >> 16, y1 >> 16, tmp >> 16);
Log(LDEBUG, "clipped against left to point (%d, %d), dy=%d/%d", x1 >> 16, y1 >> 16, tmp >> 16, tmp);
}
}
Log(LDEBUG, "final line is from (%d, %d) to (%d, %d)", x1 >> 16, y1 >> 16, x2 >> 16, y2 >> 16);