GBA Video: Fix OBJ semitransparency improperly interacting with other blending ops
Jeffrey Pfau jeffrey@endrift.com
Wed, 23 Sep 2015 20:36:57 -0700
2 files changed,
5 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -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.c
→
src/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);