mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 21:37:42 -07:00
remove more per-pixel checks
This commit is contained in:
parent
27c023a0cc
commit
d1781c8bf2
@ -986,13 +986,12 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
||||
s32 x = xstart;
|
||||
Interpolator interpX(xstart, xend+1, wl, wr, 8);
|
||||
|
||||
if (x < 0) x = 0;
|
||||
|
||||
// part 1: left edge
|
||||
edge = yedge | 0x1;
|
||||
for (; x < xstart+l_edgelen; x++)
|
||||
{
|
||||
if (x < 0) continue;
|
||||
if (x > 255) break;
|
||||
|
||||
u32 pixeladdr = 258*3 + 1 + (y*258*3) + x;
|
||||
u32 attr = (polygon->Attr & 0x3F008000) | edge;
|
||||
|
||||
@ -1102,11 +1101,6 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
||||
if (polygon->IsShadow) dstattr |= (1<<30);
|
||||
|
||||
// skip if polygon IDs are equal
|
||||
// note: this only happens if the destination pixel was translucent
|
||||
// or always when drawing a shadow
|
||||
// (the GPU keeps track of which pixels are translucent, regardless of
|
||||
// the destination alpha)
|
||||
// TODO: they say that there are two separate polygon ID buffers. verify that.
|
||||
if ((dstattr & 0x7F000000) == (attr & 0x7F000000))
|
||||
continue;
|
||||
|
||||
@ -1129,9 +1123,6 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
||||
if (wireframe && !edge) x = xend-r_edgelen+1;
|
||||
else for (; x <= xend-r_edgelen; x++)
|
||||
{
|
||||
if (x < 0) continue;
|
||||
if (x > 255) break;
|
||||
|
||||
u32 pixeladdr = 258*3 + 1 + (y*258*3) + x;
|
||||
u32 attr = (polygon->Attr & 0x3F008000) | edge;
|
||||
|
||||
@ -1212,13 +1203,12 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
||||
AttrBuffer[pixeladdr] = attr;
|
||||
}
|
||||
|
||||
if (xend > 255) xend = 255;
|
||||
|
||||
// part 3: right edge
|
||||
edge = yedge | 0x2;
|
||||
for (; x <= xend; x++)
|
||||
{
|
||||
if (x < 0) continue;
|
||||
if (x > 255) break;
|
||||
|
||||
u32 pixeladdr = 258*3 + 1 + (y*258*3) + x;
|
||||
u32 attr = (polygon->Attr & 0x3F008000) | edge;
|
||||
|
||||
@ -1328,11 +1318,6 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
|
||||
if (polygon->IsShadow) dstattr |= (1<<30);
|
||||
|
||||
// skip if polygon IDs are equal
|
||||
// note: this only happens if the destination pixel was translucent
|
||||
// or always when drawing a shadow
|
||||
// (the GPU keeps track of which pixels are translucent, regardless of
|
||||
// the destination alpha)
|
||||
// TODO: they say that there are two separate polygon ID buffers. verify that.
|
||||
if ((dstattr & 0x7F000000) == (attr & 0x7F000000))
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user