check lower pixel when top pixel ignores fog (#1808)

This commit is contained in:
Jaklyy
2023-08-12 23:38:26 -04:00
committed by GitHub
parent 5f9e7e19f3
commit f454eba3c3

View File

@ -1423,8 +1423,8 @@ void SoftRenderer::ScanlineFinalPass(s32 y)
u32 density, srccolor, srcR, srcG, srcB, srcA;
u32 attr = AttrBuffer[pixeladdr];
if (!(attr & (1<<15))) continue;
if (attr & (1<<15))
{
density = CalculateFogDensity(pixeladdr);
srccolor = ColorBuffer[pixeladdr];
@ -1443,6 +1443,7 @@ void SoftRenderer::ScanlineFinalPass(s32 y)
srcA = ((fogA * density) + (srcA * (128-density))) >> 7;
ColorBuffer[pixeladdr] = srcR | (srcG << 8) | (srcB << 16) | (srcA << 24);
}
// fog for lower pixel
// TODO: make this code nicer, but avoid using a loop