From 0d326d17b573e8bcc5388497cdaf7426213943b3 Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Sun, 18 Aug 2024 16:48:29 +1000 Subject: [PATCH] Fix use of min() macro in previous commit --- src/i_colors.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/i_colors.c b/src/i_colors.c index 93928c9d1..c85e88b79 100644 --- a/src/i_colors.c +++ b/src/i_colors.c @@ -523,7 +523,7 @@ byte V_Colorize(byte *playpal, int cr, byte source) { hsv.x = (7.0 + 53.0 * hsv.z) / 360.0; hsv.y = 1.0 - 0.4 * hsv.z; - hsv.z = min(hsv.z, 0.2) + 0.8 * hsv.z; + hsv.z = (hsv.z < 0.2 ? hsv.z : 0.2) + 0.8 * hsv.z; } else if (cr == CR_RED || cr == CR_BRICK) { @@ -539,7 +539,7 @@ byte V_Colorize(byte *playpal, int cr, byte source) if (cr == CR_BLUE1) { hsv.y = 1.0 - 0.5 * hsv.z; - hsv.z = min(hsv.z, 0.5) + 0.5 * hsv.z; + hsv.z = (hsv.z < 0.5 ? hsv.z : 0.5) + 0.5 * hsv.z; } } else if (cr == CR_ORANGE || cr == CR_TAN || cr == CR_BROWN) @@ -552,8 +552,8 @@ byte V_Colorize(byte *playpal, int cr, byte source) hsv.z = 0.5 * hsv.z; else { - hsv.y = (hsv.z < 0.6) ? 1.0 : (2.2 - 2.0 * hsv.z); - hsv.z = min(hsv.z, 0.5) + 0.5 * hsv.z; + hsv.y = (hsv.z < 0.6 ? 1.0 : (2.2 - 2.0 * hsv.z)); + hsv.z = (hsv.z < 0.5 ? hsv.z : 0.5) + 0.5 * hsv.z; } } else if (cr == CR_YELLOW)