From 095994dc96666f3d9d6866339c6fcef191d35ea2 Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Sun, 16 Apr 2023 20:07:41 -0400 Subject: [PATCH] Fixed gamma shift for special sprite palette tags (lights, emotes). Supersedes c82510e22bffb98fd9c63dc246c332dd1da602cd --- src/field_weather.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/field_weather.c b/src/field_weather.c index a875b7ec39..92673a35bb 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -493,7 +493,9 @@ static void ApplyColorMap(u8 startPalIndex, u8 numPalettes, s8 colorMapIndex) // Loop through the specified palette range and apply necessary color maps. while (curPalIndex < numPalettes) { - if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_NONE) + // don't blend special palettes immune to blending + if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_NONE || + (curPalIndex >= 16 && GetSpritePaletteTagByPaletteNum(curPalIndex - 16) >> 15)) { // No palette change. palOffset += 16; @@ -502,10 +504,7 @@ static void ApplyColorMap(u8 startPalIndex, u8 numPalettes, s8 colorMapIndex) { u8 r, g, b; - // don't blend special sprite palette tags - if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_CONTRAST || - (curPalIndex >= 16 && (curPalIndex - 16 == gWeatherPtr->contrastColorMapSpritePalIndex || - GetSpritePaletteTagByPaletteNum(curPalIndex - 16) >> 15))) + if (sPaletteColorMapTypes[curPalIndex] == COLOR_MAP_CONTRAST || curPalIndex - 16 == gWeatherPtr->contrastColorMapSpritePalIndex) colorMap = gWeatherPtr->contrastColorMaps[colorMapIndex]; else colorMap = gWeatherPtr->darkenedContrastColorMaps[colorMapIndex];