mirror of https://github.com/mgba-emu/mgba.git
DS GX: Fix alpha blending
This commit is contained in:
parent
edc88dc91e
commit
ce40b8a038
|
@ -52,6 +52,7 @@ DECL_BITS(DSGXPolygonAttrs, Lights, 0, 4);
|
|||
DECL_BITS(DSGXPolygonAttrs, Mode, 4, 2);
|
||||
DECL_BIT(DSGXPolygonAttrs, FrontFace, 6);
|
||||
DECL_BIT(DSGXPolygonAttrs, BackFace, 7);
|
||||
DECL_BIT(DSGXPolygonAttrs, UpdateDepth, 11);
|
||||
// TODO
|
||||
DECL_BITS(DSGXPolygonAttrs, Alpha, 16, 5);
|
||||
|
||||
|
|
|
@ -631,15 +631,11 @@ static void DSGXSoftwareRendererDrawScanline(struct DSGXRenderer* renderer, int
|
|||
if (span->ep[0].w < softwareRenderer->depthBuffer[x]) {
|
||||
softwareRenderer->depthBuffer[x] = span->ep[0].w;
|
||||
scanline[x] = color;
|
||||
} else if (b < 0x1F) {
|
||||
scanline[x] = _mix32(b, current, 0x1F - b, color) | a << 27;
|
||||
}
|
||||
} else {
|
||||
if (span->ep[0].z < softwareRenderer->depthBuffer[x]) {
|
||||
softwareRenderer->depthBuffer[x] = span->ep[0].z;
|
||||
scanline[x] = color;
|
||||
} else if (b < 0x1F) {
|
||||
scanline[x] = _mix32(b, current, 0x1F - b, color) | a << 27;
|
||||
}
|
||||
}
|
||||
} else if (a) {
|
||||
|
@ -650,17 +646,17 @@ static void DSGXSoftwareRendererDrawScanline(struct DSGXRenderer* renderer, int
|
|||
}
|
||||
if (softwareRenderer->wSort) {
|
||||
if (span->ep[0].w < softwareRenderer->depthBuffer[x]) {
|
||||
softwareRenderer->depthBuffer[x] = span->ep[0].w;
|
||||
if (DSGXPolygonAttrsIsUpdateDepth(span->poly->poly->polyParams)) {
|
||||
softwareRenderer->depthBuffer[x] = span->ep[0].w;
|
||||
}
|
||||
scanline[x] = color;
|
||||
} else if (b < 0x1F) {
|
||||
scanline[x] = _mix32(b, current, 0x1F - b, color) | ab << 27;
|
||||
}
|
||||
} else {
|
||||
if (span->ep[0].z < softwareRenderer->depthBuffer[x]) {
|
||||
softwareRenderer->depthBuffer[x] = span->ep[0].z;
|
||||
if (DSGXPolygonAttrsIsUpdateDepth(span->poly->poly->polyParams)) {
|
||||
softwareRenderer->depthBuffer[x] = span->ep[0].z;
|
||||
}
|
||||
scanline[x] = color;
|
||||
} else if (b < 0x1F) {
|
||||
scanline[x] = _mix32(b, current, 0x1F - b, color) | ab << 27;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue