From da10f9b3f6cad55dc5b10041be4e54f7d9b9373e Mon Sep 17 00:00:00 2001 From: StapleButter Date: Wed, 28 Jun 2017 21:19:44 +0200 Subject: fix rendering for crapoed 'butterfly' polygons --- src/GPU3D.cpp | 3 +-- src/GPU3D_Soft.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') 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(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) -- cgit v1.2.3