all repos — mgba @ 5ef980116a65c9eb31343859f87d6e3b74ffd52f

mGBA Game Boy Advance Emulator

GBA Video: Fix OBJ semitransparency improperly interacting with other blending ops
Jeffrey Pfau jeffrey@endrift.com
Wed, 23 Sep 2015 20:36:57 -0700
commit

5ef980116a65c9eb31343859f87d6e3b74ffd52f

parent

4d1b7b4591261bf9ef97774849e7fed8b801387a

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

jump to
M CHANGESCHANGES

@@ -14,6 +14,7 @@ - VFS: Fix return values of VFileFILE.read and .write

- Util: Fix PowerPC PNG read/write pixel order - GBA Video: Fix edge case with sprite blend modes and semitransparency - GBA Video: Fix objwin and blending interaction on sprites + - GBA Video: Fix OBJ semitransparency improperly interacting with other blending ops Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper
M src/gba/renderers/software-obj.csrc/gba/renderers/software-obj.c

@@ -147,7 +147,10 @@ unsigned charBase = GBAObjAttributesCGetTile(sprite->c) * 0x20;

if (GBARegisterDISPCNTGetMode(renderer->dispcnt) >= 3 && GBAObjAttributesCGetTile(sprite->c) < 512) { return 0; } - int variant = renderer->target1Obj && GBAWindowControlIsBlendEnable(renderer->currentWindow.packed) && (renderer->blendEffect == BLEND_BRIGHTEN || renderer->blendEffect == BLEND_DARKEN); + int variant = renderer->target1Obj && + GBAWindowControlIsBlendEnable(renderer->currentWindow.packed) && + (renderer->blendEffect == BLEND_BRIGHTEN || renderer->blendEffect == BLEND_DARKEN) && + GBAObjAttributesAGetMode(sprite->a) != OBJ_MODE_SEMITRANSPARENT; if (GBAObjAttributesAGetMode(sprite->a) == OBJ_MODE_SEMITRANSPARENT) { int target2 = renderer->target2Bd << 4; target2 |= renderer->bg[0].target2 << (renderer->bg[0].priority);