DS GX: Minor alpha cleanup

This commit is contained in:
Vicki Pfau 2017-03-14 02:28:48 -07:00
parent 055f705c91
commit 0d0a37c858
1 changed files with 5 additions and 8 deletions

View File

@ -549,36 +549,33 @@ static void DSGXSoftwareRendererDrawScanline(struct DSGXRenderer* renderer, int
softwareRenderer->depthBuffer[x] = ep.w; softwareRenderer->depthBuffer[x] = ep.w;
scanline[x] = color; scanline[x] = color;
} else if (b < 0x1F) { } else if (b < 0x1F) {
scanline[x] = _mix32(b, scanline[x], 0x1F - b, color) | a << 27; scanline[x] = _mix32(b, current, 0x1F - b, color) | a << 27;
} }
} else { } else {
if (ep.z < softwareRenderer->depthBuffer[x]) { if (ep.z < softwareRenderer->depthBuffer[x]) {
softwareRenderer->depthBuffer[x] = ep.z; softwareRenderer->depthBuffer[x] = ep.z;
scanline[x] = color; scanline[x] = color;
} else if (b < 0x1F) { } else if (b < 0x1F) {
scanline[x] = _mix32(b, scanline[x], 0x1F - b, color) | a << 27; scanline[x] = _mix32(b, current, 0x1F - b, color) | a << 27;
} }
} }
} else if (a) { } else if (a) {
// TODO: Disable alpha? // TODO: Disable alpha?
color = _mix32(a, color, 0x1F - a, current); color = _mix32(a, color, 0x1F - a, current);
if (scanline[x] >> 27 > a) { color |= ab << 27;
a = scanline[x] >> 27;
}
color |= a << 27;
if (softwareRenderer->wSort) { if (softwareRenderer->wSort) {
if (ep.w < softwareRenderer->depthBuffer[x]) { if (ep.w < softwareRenderer->depthBuffer[x]) {
softwareRenderer->depthBuffer[x] = ep.w; softwareRenderer->depthBuffer[x] = ep.w;
scanline[x] = color; scanline[x] = color;
} else if (b < 0x1F) { } else if (b < 0x1F) {
scanline[x] = _mix32(b, scanline[x], 0x1F - b, color) | ab << 27; scanline[x] = _mix32(b, current, 0x1F - b, color) | ab << 27;
} }
} else { } else {
if (ep.z < softwareRenderer->depthBuffer[x]) { if (ep.z < softwareRenderer->depthBuffer[x]) {
softwareRenderer->depthBuffer[x] = ep.z; softwareRenderer->depthBuffer[x] = ep.z;
scanline[x] = color; scanline[x] = color;
} else if (b < 0x1F) { } else if (b < 0x1F) {
scanline[x] = _mix32(b, scanline[x], 0x1F - b, color) | ab << 27; scanline[x] = _mix32(b, current, 0x1F - b, color) | ab << 27;
} }
} }
} }