From 43bea5f6f20b4a58b083ccb0b380e78180017128 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 12 Dec 2022 20:17:30 +0000 Subject: [PATCH] mkhighlight: Don't darken the base colour if we don't need a highlight The "mkhighlight" functions can now take -1 as the requested highlight or lowlight colour as an indication that no such colour should be returned. If the caller doesn't want a highlight colour, there's not much point in darkening the base colour to make it distinct from the highlight, so don't do that. This means that the background colours in Palisade and Untangle are no longer unnecessarily darkened. --- misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc.c b/misc.c index 992f1a5..655b6ae 100644 --- a/misc.c +++ b/misc.c @@ -211,7 +211,7 @@ void game_mkhighlight_specific(frontend *fe, float *ret, for (i = 1; i < 3; i++) if (ret[background*3+i] > max) max = ret[background*3+i]; - if (max * 1.2F > 1.0F) { + if (highlight >= 0 && max * 1.2F > 1.0F) { for (i = 0; i < 3; i++) ret[background*3+i] /= (max * 1.2F); }