Changes

From DoomWiki.org

Carmack's typo

5 bytes added, 18:13, 14 June 2019
m
Added line number to the ref link
'''Carmack's typo''' was a minor bug in {{c|dcolors.c}}, a program written by [[John Carmack]] in {{timeline|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 {{c|red*0.299 + green*0.587 + blue*0.114}}. In the utility, Carmack accidentally wrote {{c|0.144}} instead of {{c|0.114}}, meaning that the invulnerability colormap converts all blues to be slightly too dark.{{cite web|author=[[Andrew Stine (Linguica)|Stine, Andrew]]|title=dmutils GitHub repository|url=https://github.com/linguica/dmutils/blob/master/dcolors.c#L194|publication=GitHub|publishdate=|accessdate=}} 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==
26
edits