From 3c572f8395e0735ae8dd1af62369a8eb43f84518 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sun, 17 Mar 2024 11:20:55 +0700 Subject: [PATCH] add comment about "Carmack's typo" --- src/v_video.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/v_video.c b/src/v_video.c index 18dcadc0..2124e2aa 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -208,6 +208,8 @@ void V_InitColorTranslation(void) double green = *palsrc++ / 256.0; double blue = *palsrc++ / 256.0; + // formula is taken from dcolors.c preseving "Carmack's typo" + // https://doomwiki.org/wiki/Carmack%27s_typo int gray = (red * 0.299 + green * 0.587 + blue * 0.144) * 255; invul_gray[i] = I_GetPaletteIndex(playpal, gray, gray, gray); }