all repos — mgba @ 0120ea93a54b2e9700b99fa785d079c1efe8dafe

mGBA Game Boy Advance Emulator

Sprites shouldn't be blended if the current window has blending disabled
Jeffrey Pfau jeffrey@endrift.com
Tue, 15 Oct 2013 21:44:47 -0700
commit

0120ea93a54b2e9700b99fa785d079c1efe8dafe

parent

ce33adf5e4bbc5c123d67aa8a25acd853a3d1470

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

jump to
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -1234,7 +1234,7 @@ if ((y < sprite->y && (sprite->y + height - 256 < 0 || y >= sprite->y + height - 256)) || y >= sprite->y + height) {

return; } uint32_t flags = (sprite->priority << OFFSET_PRIORITY) | FLAG_FINALIZED; - flags |= FLAG_TARGET_1 * ((renderer->target1Obj && renderer->blendEffect == BLEND_ALPHA) || sprite->mode == OBJ_MODE_SEMITRANSPARENT); + flags |= FLAG_TARGET_1 * ((renderer->currentWindow.blendEnable && renderer->target1Obj && renderer->blendEffect == BLEND_ALPHA) || sprite->mode == OBJ_MODE_SEMITRANSPARENT); flags |= FLAG_TARGET_2 *renderer->target2Obj; flags |= FLAG_OBJWIN * (sprite->mode == OBJ_MODE_OBJWIN); int x = sprite->x;

@@ -1277,7 +1277,7 @@ if ((y < sprite->y && (sprite->y + totalHeight - 256 < 0 || y >= sprite->y + totalHeight - 256)) || y >= sprite->y + totalHeight) {

return; } uint32_t flags = (sprite->priority << OFFSET_PRIORITY) | FLAG_FINALIZED; - flags |= FLAG_TARGET_1 * ((renderer->target1Obj && renderer->blendEffect == BLEND_ALPHA) || sprite->mode == OBJ_MODE_SEMITRANSPARENT); + flags |= FLAG_TARGET_1 * ((renderer->currentWindow.blendEnable && renderer->target1Obj && renderer->blendEffect == BLEND_ALPHA) || sprite->mode == OBJ_MODE_SEMITRANSPARENT); flags |= FLAG_TARGET_2 * renderer->target2Obj; flags |= FLAG_OBJWIN * (sprite->mode == OBJ_MODE_OBJWIN); int x = sprite->x;