]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix interpretation of text brightness/contrast cvars when a color multiplier is set
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 Dec 2008 16:55:09 +0000 (16:55 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 Dec 2008 16:55:09 +0000 (16:55 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8604 d7cf8633-e32d-0410-b094-e92efae38249

gl_draw.c

index b64760fdb8cb99bee303f857b09381ca76f3cb52..d1d52a665f880af3f9659f269cce2c3da21cc743 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -931,10 +931,10 @@ static void DrawQ_GetTextColor(float color[4], int colorindex, float r, float g,
        }
        else
                Vector4Copy(string_colors[colorindex], color);
-       Vector4Set(color, (color[0] * C + B) * r, (color[1] * C + B) * g, (color[2] * C + B) * b, color[3] * a);
+       Vector4Set(color, color[0] * r * C + B, color[1] * g * C + B, color[2] * b * C + B, color[3] * a);
        if (shadow)
        {
-               float shadowalpha = color[0]+color[1]+color[2] * 0.8;
+               float shadowalpha = (color[0]+color[1]+color[2]) * 0.8;
                Vector4Set(color, 0, 0, 0, color[3] * bound(0, shadowalpha, 1));
        }
 }
@@ -1093,6 +1093,7 @@ float DrawQ_String_Font(float startx, float starty, const char *text, size_t max
                        colorindex = STRING_COLOR_DEFAULT;
                else
                        colorindex = *outcolor;
+
                DrawQ_GetTextColor(color, colorindex, basered, basegreen, baseblue, basealpha, shadow);
 
                x = startx;