fix rendering for crapoed 'butterfly' polygons

This commit is contained in:
StapleButter 2017-06-28 21:19:44 +02:00
parent 209a639461
commit da10f9b3f6
2 changed files with 7 additions and 6 deletions

View File

@ -723,8 +723,7 @@ void SubmitPolygon()
// clipping // clipping
nverts = ClipPolygon<true>(clippedvertices, nverts, clipstart); nverts = ClipPolygon<true>(clippedvertices, nverts, clipstart);
//if (((CurPolygonAttr >> 16) & 0x1F) != 0x1F) nverts=0;
//CurPolygonAttr|=0x1F0000;
if (nverts == 0) if (nverts == 0)
{ {
LastStripPolygon = NULL; LastStripPolygon = NULL;

View File

@ -255,10 +255,10 @@ public:
return x0; 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->x0 = x0;
this->y = y0; this->y = y;
if (x1 > x0) if (x1 > x0)
{ {
@ -310,6 +310,8 @@ public:
else dx = 0; else dx = 0;
} }
dx += (y - y0) * Increment;
s32 x = XVal(); s32 x = XVal();
if (XMajor) 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], 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->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) 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], 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->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) void SetupPolygon(RendererPolygon* rp, Polygon* polygon)