all repos — mgba @ 7cd72f3519e7b2e215bb0e80436d53d9c4ce2903

mGBA Game Boy Advance Emulator

DS Video: Blend 3D layer as needed
Vicki Pfau vi@endrift.com
Wed, 01 Mar 2017 23:13:40 -0800
commit

7cd72f3519e7b2e215bb0e80436d53d9c4ce2903

parent

80ff9596b98944a5626fd6819b8eda861013c38c

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M src/ds/renderers/software.csrc/ds/renderers/software.c

@@ -386,10 +386,12 @@ if (DSRegisterDISPCNTIs3D(softwareRenderer->dispcnt) && gx) {

color_t* scanline; gx->renderer->getScanline(gx->renderer, y, &scanline); uint32_t flags = (softwareRenderer->bg[0].priority << OFFSET_PRIORITY) | FLAG_IS_BACKGROUND; + flags |= FLAG_TARGET_2 * softwareRenderer->bg[0].target2; + flags |= FLAG_TARGET_1 * (softwareRenderer->bg[0].target1 && softwareRenderer->blendEffect == BLEND_ALPHA && GBAWindowControlIsBlendEnable(softwareRenderer->currentWindow.packed)); int x; for (x = softwareRenderer->start; x < softwareRenderer->end; ++x) { if ((scanline[x] & FLAG_UNWRITTEN) != FLAG_UNWRITTEN) { - _compositeNoBlendNoObjwin(softwareRenderer, &softwareRenderer->row[x], scanline[x] | flags, softwareRenderer->row[x]); + _compositeBlendNoObjwin(softwareRenderer, &softwareRenderer->row[x], scanline[x] | flags, softwareRenderer->row[x]); } } } else {