aboutsummaryrefslogtreecommitdiff
path: root/src
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
parent209a639461a9223af7114593ebd9aef0c5486aed (diff)
fix rendering for crapoed 'butterfly' polygons
Diffstat (limited to 'src')
-rw-r--r--src/GPU3D.cpp3
-rw-r--r--src/GPU3D_Soft.cpp10
2 files changed, 7 insertions, 6 deletions
diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp
index db445c0..ca16faa 100644
--- a/src/GPU3D.cpp
+++ b/src/GPU3D.cpp
@@ -723,8 +723,7 @@ void SubmitPolygon()
// clipping
nverts = ClipPolygon<true>(clippedvertices, nverts, clipstart);
-//if (((CurPolygonAttr >> 16) & 0x1F) != 0x1F) nverts=0;
-//CurPolygonAttr|=0x1F0000;
+
if (nverts == 0)
{
LastStripPolygon = NULL;
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)