misc optimizations

This commit is contained in:
StapleButter
2017-04-25 01:14:26 +02:00
parent 61798ac880
commit 9eb68c2ede
4 changed files with 33 additions and 22 deletions

View File

@ -894,6 +894,10 @@ void RenderPolygon(Polygon* polygon)
r_filledge = slope_end->Increment==0;
}
int yedge = 0;
if (y == ytop) yedge = 0x4;
else if (y == ybot-1) yedge = 0x8;
Interpolator interpX(xstart, xend+1, wl, wr, 8);
for (s32 x = xstart; x <= xend; x++)
@ -901,9 +905,7 @@ void RenderPolygon(Polygon* polygon)
if (x < 0) continue;
if (x > 255) break;
int edge = 0;
if (y == ytop) edge |= 0x4;
else if (y == ybot-1) edge |= 0x8;
int edge = yedge;
if (x < l_edgeend) edge |= 0x1;
else if (x > r_edgestart) edge |= 0x2;
@ -966,14 +968,7 @@ void RenderPolygon(Polygon* polygon)
// alpha test
// TODO: check alpha test when blending is disabled
if (DispCnt & (1<<2))
{
if (alpha <= AlphaRef) continue;
}
else
{
if (alpha == 0) continue;
}
if (alpha <= AlphaRef) continue;
if (alpha == 31)
{