aboutsummaryrefslogtreecommitdiff
path: root/src/GPU3D_Soft.cpp
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-06-28 21:19:44 +0200
committerStapleButter <thetotalworm@gmail.com>2017-06-28 21:19:44 +0200
commitda10f9b3f6cad55dc5b10041be4e54f7d9b9373e (patch)
treeeeec4660fe38e50e23caff9d2290fd7ac8027bb9 /src/GPU3D_Soft.cpp
parent209a639461a9223af7114593ebd9aef0c5486aed (diff)
fix rendering for crapoed 'butterfly' polygons
Diffstat (limited to 'src/GPU3D_Soft.cpp')
-rw-r--r--src/GPU3D_Soft.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp
index 482a28d..ab7f517 100644
--- a/src/GPU3D_Soft.cpp
+++ b/src/GPU3D_Soft.cpp
@@ -255,10 +255,10 @@ public:
return x0;
}
- s32 Setup(s32 x0, s32 x1, s32 y0, s32 y1, s32 w0, s32 w1)
+ s32 Setup(s32 x0, s32 x1, s32 y0, s32 y1, s32 w0, s32 w1, s32 y)
{
this->x0 = x0;
- this->y = y0;
+ this->y = y;
if (x1 > x0)
{
@@ -310,6 +310,8 @@ public:
else dx = 0;
}
+ dx += (y - y0) * Increment;
+
s32 x = XVal();
if (XMajor)
@@ -831,7 +833,7 @@ void SetupPolygonLeftEdge(RendererPolygon* rp, s32 y)
rp->XL = rp->SlopeL.Setup(polygon->Vertices[rp->CurVL]->FinalPosition[0], polygon->Vertices[rp->NextVL]->FinalPosition[0],
polygon->Vertices[rp->CurVL]->FinalPosition[1], polygon->Vertices[rp->NextVL]->FinalPosition[1],
- polygon->FinalW[rp->CurVL], polygon->FinalW[rp->NextVL]);
+ polygon->FinalW[rp->CurVL], polygon->FinalW[rp->NextVL], y);
}
void SetupPolygonRightEdge(RendererPolygon* rp, s32 y)
@@ -858,7 +860,7 @@ void SetupPolygonRightEdge(RendererPolygon* rp, s32 y)
rp->XR = rp->SlopeR.Setup(polygon->Vertices[rp->CurVR]->FinalPosition[0], polygon->Vertices[rp->NextVR]->FinalPosition[0],
polygon->Vertices[rp->CurVR]->FinalPosition[1], polygon->Vertices[rp->NextVR]->FinalPosition[1],
- polygon->FinalW[rp->CurVR], polygon->FinalW[rp->NextVR]);
+ polygon->FinalW[rp->CurVR], polygon->FinalW[rp->NextVR], y);
}
void SetupPolygon(RendererPolygon* rp, Polygon* polygon)