fix Z-buffering. not really clean, and not perfectly accurate.

This commit is contained in:
StapleButter
2017-04-29 00:20:04 +02:00
parent 2273bd2ea4
commit da31af9202
3 changed files with 10 additions and 9 deletions

View File

@ -839,6 +839,7 @@ void SubmitPolygon()
poly->YTop = ytop; poly->YBottom = ybot;
poly->XTop = xtop; poly->XBottom = xbot;
poly->WShift = wshift;
poly->WBuffer = (FlushAttributes & 0x2);
for (int i = 0; i < nverts; i++)
{
@ -849,7 +850,6 @@ void SubmitPolygon()
if (FlushAttributes & 0x2)
z = w << wshift;
else
//z = vtx->Position[2]+0x7FFFFF;//((vtx->Position[2] + (w<<wshift)) * 0x1000) / (w<<(wshift+1));
z = (((s64)vtx->Position[2] * 0x800000) / (w << wshift)) + 0x7FFEFF;
// checkme