From 1505f756697f6dcb28eb60250e7a3c198b805ba9 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 28 May 2017 23:57:09 +0200 Subject: [PATCH] - Fix testcolor and testfade in the software renderer --- src/swrenderer/r_swcolormaps.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/swrenderer/r_swcolormaps.h b/src/swrenderer/r_swcolormaps.h index 3159432dc..76d5faa53 100644 --- a/src/swrenderer/r_swcolormaps.h +++ b/src/swrenderer/r_swcolormaps.h @@ -57,13 +57,11 @@ FORCEINLINE FDynamicColormap *GetColorTable(const FColormap &cm, PalEntry Specia c.Decolorize(); c = SpecialColor.Modulate(c); } - auto p = &NormalLight; - if (c == p->Color && - cm.FadeColor == p->Fade && - cm.Desaturation == p->Desaturate) - { - return p; - } + + // First colormap is the default Doom colormap. + // testcolor and testfade CCMDs modifies the first colormap, so we have to do the check without looking at the actual values stored in NormalLight. + if (c == PalEntry(255, 255, 255) && cm.FadeColor == 0 && cm.Desaturation == 0) + return &NormalLight; return GetSpecialLights(c, cm.FadeColor, cm.Desaturation); }