aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-04-22 17:15:50 +0200
committerStapleButter <thetotalworm@gmail.com>2017-04-22 17:15:50 +0200
commit70c72004acb079ff669d2916ba9fc0144f32472a (patch)
treef8111b0825e2433d20971ae082d6aab04e735553 /src
parent4f72ee389560a471313dc6f646e0b0074302fab0 (diff)
behavior for translucent pixels is preserved even when alphablending is disabled
Diffstat (limited to 'src')
-rw-r--r--src/GPU3D_Soft.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp
index 6dd5676..888b823 100644
--- a/src/GPU3D_Soft.cpp
+++ b/src/GPU3D_Soft.cpp
@@ -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;