behavior for translucent pixels is preserved even when alphablending is disabled

This commit is contained in:
StapleButter 2017-04-22 17:15:50 +02:00
parent 4f72ee3895
commit 70c72004ac
1 changed files with 2 additions and 6 deletions

View File

@ -924,6 +924,7 @@ void RenderPolygon(Polygon* polygon)
u8 alpha = color >> 24;
// alpha test
// TODO: check alpha test when blending is disabled
if (DispCnt & (1<<2))
{
if (alpha <= AlphaRef) continue;
@ -933,11 +934,6 @@ void RenderPolygon(Polygon* polygon)
if (alpha == 0) continue;
}
// alpha blending disable
// TODO: check alpha test when blending is disabled
if (!(DispCnt & (1<<3)))
alpha = 31;
if (alpha == 31)
{
// edge fill rules for opaque pixels
@ -967,7 +963,7 @@ void RenderPolygon(Polygon* polygon)
u32 dstcolor = ColorBuffer[pixeladdr];
u32 dstalpha = dstcolor >> 24;
if (dstalpha > 0)
if ((dstalpha > 0) && (DispCnt & (1<<3)))
{
u32 srcR = color & 0x3F;
u32 srcG = (color >> 8) & 0x3F;