don't try to add contrast to the blend if we don't yet know what contrast is

This commit is contained in:
Bill Currie 2001-10-20 18:51:15 +00:00
parent aed7b1c08d
commit 0bca15c502
1 changed files with 9 additions and 6 deletions

View File

@ -87,7 +87,9 @@ V_CalcBlend (void)
a = 1.0 - a3;
}
if ((a2 = 1 - bound (0.0, contrast->value, 1.0)) < 0.999) { // add contrast
if (contrast) {
if ((a2 = 1 - bound (0.0, contrast->value, 1.0)) < 0.999) {
// add contrast
r += (128 - r) * a2;
g += (128 - g) * a2;
b += (128 - b) * a2;
@ -95,6 +97,7 @@ V_CalcBlend (void)
a3 = (1.0 - a) * (1.0 - a2);
a = 1.0 - a3;
}
}
// LordHavoc: saturate color
if (a) {