- fix /0 error caused by having a completely black font character. this error was triggered by Return of the Triad.

This commit is contained in:
Rachael Alexanderson 2021-07-13 00:15:29 -04:00
parent e02690af58
commit cb8ae0b560

View file

@ -673,6 +673,10 @@ void V_ApplyLuminosityTranslation(int translation, uint8_t* pixel, int size)
int lum_range = (lum_max - lum_min + 1);
PalEntry* remap = paletteptr + colorrange * 256;
// why was this ever allowed to divide by zero?
if (!lum_max)
lum_max++;
for (int i = 0; i < size; i++, pixel += 4)
{
// we must also process the transparent pixels here to ensure proper filtering on the characters' edges.