all repos — mgba @ 40e9a7ef266042c036ab9b689038ceffda193aed

mGBA Game Boy Advance Emulator

Update variant palettes when writing to palette
Jeffrey Pfau jeffrey@endrift.com
Wed, 01 May 2013 02:37:15 -0700
commit

40e9a7ef266042c036ab9b689038ceffda193aed

parent

03361f20a2c8bb4ba5924bbcfbb79edce28fc20a

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

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

@@ -194,6 +194,11 @@ color32 |= (value << 3) & 0xF8;

color32 |= (value << 6) & 0xF800; color32 |= (value << 9) & 0xF80000; softwareRenderer->normalPalette[address >> 1] = color32; + if (softwareRenderer->blendEffect == BLEND_BRIGHTEN) { + softwareRenderer->variantPalette[address >> 1] = _brighten(color32, softwareRenderer->bldy); + } else if (softwareRenderer->blendEffect == BLEND_DARKEN) { + softwareRenderer->variantPalette[address >> 1] = _darken(color32, softwareRenderer->bldy); + } } static void GBAVideoSoftwareRendererDrawScanline(struct GBAVideoRenderer* renderer, int y) {