fix bugs with line polygons
This commit is contained in:
parent
886bf6bc10
commit
34c60eaca4
|
@ -1144,6 +1144,23 @@ void SubmitPolygon()
|
||||||
for (int i = clipstart; i < nverts; i++)
|
for (int i = clipstart; i < nverts; i++)
|
||||||
clippedvertices[i] = TempVertexBuffer[i];
|
clippedvertices[i] = TempVertexBuffer[i];
|
||||||
|
|
||||||
|
// detect lines, for the OpenGL renderer
|
||||||
|
|
||||||
|
int polytype = 0;
|
||||||
|
if (nverts == 3)
|
||||||
|
{
|
||||||
|
if (ClipCoordsEqual(&clippedvertices[0], &clippedvertices[1]) ||
|
||||||
|
ClipCoordsEqual(&clippedvertices[0], &clippedvertices[2]) ||
|
||||||
|
ClipCoordsEqual(&clippedvertices[1], &clippedvertices[2]))
|
||||||
|
{
|
||||||
|
polytype = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (nverts == 4)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
// clipping
|
// clipping
|
||||||
|
|
||||||
nverts = ClipPolygon<true>(clippedvertices, nverts, clipstart);
|
nverts = ClipPolygon<true>(clippedvertices, nverts, clipstart);
|
||||||
|
@ -1198,21 +1215,7 @@ void SubmitPolygon()
|
||||||
|
|
||||||
if (!poly->Translucent) NumOpaquePolygons++;
|
if (!poly->Translucent) NumOpaquePolygons++;
|
||||||
|
|
||||||
if (ClipCoordsEqual(v0, v1) ||
|
poly->Type = polytype;
|
||||||
ClipCoordsEqual(v0, v2) ||
|
|
||||||
ClipCoordsEqual(v1, v2))
|
|
||||||
{
|
|
||||||
poly->Type = 1;
|
|
||||||
}
|
|
||||||
else if (nverts == 4)
|
|
||||||
{
|
|
||||||
if (ClipCoordsEqual(v0, v3) ||
|
|
||||||
ClipCoordsEqual(v1, v3) ||
|
|
||||||
ClipCoordsEqual(v2, v3))
|
|
||||||
{
|
|
||||||
poly->Type = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LastStripPolygon && clipstart > 0)
|
if (LastStripPolygon && clipstart > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -582,7 +582,10 @@ void BuildPolygons(RendererPolygon* polygons, int npolys)
|
||||||
y = vtx->FinalPosition[1];
|
y = vtx->FinalPosition[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastx == x && lasty == y) continue;
|
if (j > 0)
|
||||||
|
{
|
||||||
|
if (lastx == x && lasty == y) continue;
|
||||||
|
}
|
||||||
|
|
||||||
*vptr++ = x | (y << 16);
|
*vptr++ = x | (y << 16);
|
||||||
*vptr++ = z | (w << 16);
|
*vptr++ = z | (w << 16);
|
||||||
|
|
Loading…
Reference in New Issue