mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Fix highlighting for sprites with mid-frame palette changes
This commit is contained in:
parent
81289cdb62
commit
511a12c507
1
CHANGES
1
CHANGES
|
@ -61,6 +61,7 @@ Misc:
|
||||||
- GBA Cheats: Implement "never" type codes (closes mgba.io/i/915)
|
- GBA Cheats: Implement "never" type codes (closes mgba.io/i/915)
|
||||||
- GBA DMA: Enhanced logging (closes mgba.io/i/2454)
|
- GBA DMA: Enhanced logging (closes mgba.io/i/2454)
|
||||||
- GBA Video: Implement layer placement for OpenGL renderer (fixes mgba.io/i/1962)
|
- GBA Video: Implement layer placement for OpenGL renderer (fixes mgba.io/i/1962)
|
||||||
|
- GBA Video: Fix highlighting for sprites with mid-frame palette changes
|
||||||
- mGUI: Add margin to right-aligned menu text (fixes mgba.io/i/871)
|
- mGUI: Add margin to right-aligned menu text (fixes mgba.io/i/871)
|
||||||
- mGUI: Autosave less frequently when fast-forwarding
|
- mGUI: Autosave less frequently when fast-forwarding
|
||||||
- Qt: Rearrange menus some
|
- Qt: Rearrange menus some
|
||||||
|
|
|
@ -437,6 +437,14 @@ static void GBAVideoSoftwareRendererWritePalette(struct GBAVideoRenderer* render
|
||||||
} else if (softwareRenderer->blendEffect == BLEND_DARKEN) {
|
} else if (softwareRenderer->blendEffect == BLEND_DARKEN) {
|
||||||
softwareRenderer->variantPalette[address >> 1] = _darken(color, softwareRenderer->bldy);
|
softwareRenderer->variantPalette[address >> 1] = _darken(color, softwareRenderer->bldy);
|
||||||
}
|
}
|
||||||
|
int highlightAmount = renderer->highlightAmount >> 4;
|
||||||
|
if (highlightAmount) {
|
||||||
|
softwareRenderer->highlightPalette[address >> 1] = mColorMix5Bit(0x10 - highlightAmount, softwareRenderer->normalPalette[address >> 1], highlightAmount, renderer->highlightColor);
|
||||||
|
softwareRenderer->highlightVariantPalette[address >> 1] = mColorMix5Bit(0x10 - highlightAmount, softwareRenderer->variantPalette[address >> 1], highlightAmount, renderer->highlightColor);
|
||||||
|
} else {
|
||||||
|
softwareRenderer->highlightPalette[address >> 1] = softwareRenderer->normalPalette[address >> 1];
|
||||||
|
softwareRenderer->highlightVariantPalette[address >> 1] = softwareRenderer->variantPalette[address >> 1];
|
||||||
|
}
|
||||||
if (renderer->cache) {
|
if (renderer->cache) {
|
||||||
mCacheSetWritePalette(renderer->cache, address >> 1, color);
|
mCacheSetWritePalette(renderer->cache, address >> 1, color);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue