Carmack's typo

From DoomWiki.org

Revision as of 12:13, 14 June 2019 by Egor (talk | contribs) (Added line number to the ref link)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Carmack's typo was a minor bug in dcolors.c, a program written by John Carmack in 1992 during early development of Doom. To generate the invulnerability colormap, Carmack converted each color in the palette to a gray scale value using a standard formula, where the gray scale value equals red*0.299 + green*0.587 + blue*0.114. In the utility, Carmack accidentally wrote 0.144 instead of 0.114, meaning that the invulnerability colormap converts all blues to be slightly too dark.[1] Since the invulnerability colormap inverts the gray scale palette, this means the gray scale colors converted from blue are calculated as brighter than they should be, and so become darker than they should be when the palette is inverted.

References[edit]

  1. Stine, Andrew. "dmutils GitHub repository." GitHub.