all repos — mgba @ ebe765d1cdff19d02a7b59527cb1263cc17ad4e6

mGBA Game Boy Advance Emulator

GBA Video: Fix alpha issues on GL output texture
Vicki Pfau vi@endrift.com
Mon, 27 May 2019 14:22:11 -0700
commit

ebe765d1cdff19d02a7b59527cb1263cc17ad4e6

parent

5b66a455b0226aa84fcd953c7ebdb70850971b46

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

jump to
M src/gba/renderers/gl.csrc/gba/renderers/gl.c

@@ -568,12 +568,12 @@ " if ((layerWindow & 32) == 0) {\n"

" topFlags.y &= ~1;\n" " }\n" " if (((topFlags.y & 13) == 5 || topFlags.w > 0) && (bottomFlags.y & 2) == 2) {\n" - " topPixel *= float(topFlags.z) / 16.;\n" - " topPixel += bottomPixel * float(windowFlags.y) / 16.;\n" + " topPixel.rgb *= float(topFlags.z) / 16.;\n" + " topPixel.rgb += bottomPixel.rgb * float(windowFlags.y) / 16.;\n" " } else if ((topFlags.y & 13) == 9) {\n" - " topPixel += (1. - topPixel) * float(windowFlags.z) / 16.;\n" + " topPixel.rgb += (1. - topPixel.rgb) * float(windowFlags.z) / 16.;\n" " } else if ((topFlags.y & 13) == 13) {\n" - " topPixel -= topPixel * float(windowFlags.z) / 16.;\n" + " topPixel.rgb -= topPixel.rgb * float(windowFlags.z) / 16.;\n" " }\n" " color = topPixel;\n" "}";

@@ -1343,7 +1343,7 @@ glViewport(0, 0, 1, GBA_VIDEO_VERTICAL_PIXELS);

glScissor(0, glRenderer->firstY, 1, y - glRenderer->firstY + 1); glBindFramebuffer(GL_FRAMEBUFFER, glRenderer->fbo[GBA_GL_FBO_BACKDROP]); glDrawBuffers(2, (GLenum[]) { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 }); - glClearBufferfv(GL_COLOR, 0, (GLfloat[]) { ((backdrop >> 16) & 0xFF) / 256., ((backdrop >> 8) & 0xFF) / 256., (backdrop & 0xFF) / 256., 0.f }); + glClearBufferfv(GL_COLOR, 0, (GLfloat[]) { ((backdrop >> 16) & 0xFF) / 256., ((backdrop >> 8) & 0xFF) / 256., (backdrop & 0xFF) / 256., 1.f }); glClearBufferiv(GL_COLOR, 1, (GLint[]) { 32, glRenderer->target1Bd | (glRenderer->target2Bd * 2) | (glRenderer->blendEffect * 4), glRenderer->blda, 0 }); glDrawBuffers(1, (GLenum[]) { GL_COLOR_ATTACHMENT0 });