mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GPU: Keep diagonal lines the same width.
This commit is contained in:
parent
60bd25582c
commit
76e1690646
1 changed files with 7 additions and 3 deletions
|
@ -796,9 +796,13 @@ void SoftwareTransform::ExpandLines(int vertexCount, int &maxIndex, u16 *&inds,
|
||||||
TransformedVertex transVtxBL = transformed[indsIn[i + 1]];
|
TransformedVertex transVtxBL = transformed[indsIn[i + 1]];
|
||||||
|
|
||||||
// Okay, let's calculate the perpendicular biased toward the bottom right.
|
// Okay, let's calculate the perpendicular biased toward the bottom right.
|
||||||
float horizontal = fabsf(transVtxTL.x - transVtxBL.x);
|
float horizontal = transVtxTL.x - transVtxBL.x;
|
||||||
float vertical = fabsf(transVtxTL.y - transVtxBL.y);
|
float vertical = transVtxTL.y - transVtxBL.y;
|
||||||
Vec2f addWidth = Vec2f(vertical, horizontal).Normalized();
|
Vec2f addWidth = Vec2f(-vertical, horizontal).Normalized();
|
||||||
|
// We'll bias mostly straight lines and try to keep diagonal lines at 90 degrees.
|
||||||
|
if (fabsf(addWidth.y) < fabsf(addWidth.x / 16.0f)) {
|
||||||
|
addWidth.x = -addWidth.x;
|
||||||
|
}
|
||||||
|
|
||||||
// bottom right
|
// bottom right
|
||||||
trans[0] = transVtxBL;
|
trans[0] = transVtxBL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue