move the W=0 check, to be sure to check all the vertices

This commit is contained in:
StapleButter 2018-12-20 01:40:32 +01:00
parent f6e6fa05ea
commit f86fe46035
1 changed files with 2 additions and 4 deletions

View File

@ -1171,7 +1171,6 @@ void SubmitPolygon()
{
posX = 0;
posY = 0;
poly->Degenerate = true;
}
else
{
@ -1218,6 +1217,8 @@ void SubmitPolygon()
}
u32 w = (u32)vtx->Position[3];
if (w == 0) poly->Degenerate = true;
while ((w >> wsize) && (wsize < 32))
wsize += 4;
}
@ -1287,9 +1288,6 @@ void SubmitVertex()
vertextrans->Position[2] = (vertex[0]*ClipMatrix[2] + vertex[1]*ClipMatrix[6] + vertex[2]*ClipMatrix[10] + vertex[3]*ClipMatrix[14]) >> 12;
vertextrans->Position[3] = (vertex[0]*ClipMatrix[3] + vertex[1]*ClipMatrix[7] + vertex[2]*ClipMatrix[11] + vertex[3]*ClipMatrix[15]) >> 12;
//vertextrans->Position[3] &= 0x00FFFFFF;
//if (vertextrans->Position[3] < 0) printf("NEGATIVE W: %08X\n", vertextrans->Position[3]);
// this probably shouldn't be.
// the way color is handled during clipping needs investigation. TODO
vertextrans->Color[0] = (VertexColor[0] << 12) + 0xFFF;