]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/color.qh
Add some missing parenthesis
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / color.qh
index d1fdc2c3bcf39d82b3249c9c10f457b395e02a7a..6f7a7326de41f5cce1953dc26a5ac27aa933296d 100644 (file)
@@ -3,6 +3,7 @@
 #include "string.qh"
 
 #define colormapPaletteColor(c, isPants) colormapPaletteColor_(c, isPants, time)
+ERASEABLE
 vector colormapPaletteColor_(int c, bool isPants, float t)
 {
        switch (c)
@@ -24,17 +25,18 @@ vector colormapPaletteColor_(int c, bool isPants, float t)
                case 14: return '1.000000 0.666667 0.000000';
                case 15:
                        if (isPants)
-                               return '1 0 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 0.0000000000))
-                                      + '0 1 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 2.0943951024))
-                                      + '0 0 1' * (0.502 + 0.498 * sin(t / 2.7182818285 + 4.1887902048));
+                               return '1 0 0' * (0.502 + 0.498 * sin(t / M_E + 0))
+                                       + '0 1 0' * (0.502 + 0.498 * sin(t / M_E + M_PI * 2 / 3))
+                                       + '0 0 1' * (0.502 + 0.498 * sin(t / M_E + M_PI * 4 / 3));
                        else
-                               return '1 0 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 5.2359877560))
-                                      + '0 1 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 3.1415926536))
-                                      + '0 0 1' * (0.502 + 0.498 * sin(t / 3.1415926536 + 1.0471975512));
+                               return '1 0 0' * (0.502 + 0.498 * sin(t / M_PI + M_PI * 5 / 3))
+                                       + '0 1 0' * (0.502 + 0.498 * sin(t / M_PI + M_PI))
+                                       + '0 0 1' * (0.502 + 0.498 * sin(t / M_PI + M_PI * 1 / 3));
                default: return '0.000 0.000 0.000';
        }
 }
 
+ERASEABLE
 float rgb_mi_ma_to_hue(vector rgb, float mi, float ma)
 {
        if (mi == ma)
@@ -56,6 +58,7 @@ float rgb_mi_ma_to_hue(vector rgb, float mi, float ma)
        }
 }
 
+ERASEABLE
 vector hue_mi_ma_to_rgb(float hue, float mi, float ma)
 {
        vector rgb;
@@ -110,6 +113,7 @@ vector hue_mi_ma_to_rgb(float hue, float mi, float ma)
        return rgb;
 }
 
+ERASEABLE
 vector rgb_to_hsv(vector rgb)
 {
        float mi, ma;
@@ -127,11 +131,13 @@ vector rgb_to_hsv(vector rgb)
        return hsv;
 }
 
+ERASEABLE
 vector hsv_to_rgb(vector hsv)
 {
        return hue_mi_ma_to_rgb(hsv.x, hsv.z * (1 - hsv.y), hsv.z);
 }
 
+ERASEABLE
 vector rgb_to_hsl(vector rgb)
 {
        float mi, ma;
@@ -151,6 +157,7 @@ vector rgb_to_hsl(vector rgb)
        return hsl;
 }
 
+ERASEABLE
 vector hsl_to_rgb(vector hsl)
 {
        float mi, ma, maminusmi;
@@ -166,6 +173,7 @@ vector hsl_to_rgb(vector hsl)
        return hue_mi_ma_to_rgb(hsl.x, mi, ma);
 }
 
+ERASEABLE
 string rgb_to_hexcolor(vector rgb)
 {
        return strcat(