]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/slider_decibels.qc
Rename a few parameters and locals named x, y, z
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / slider_decibels.qc
index c3eb4b0abd1cf2226480eeba3176c4a22a91f631..dcc2c85b06a1746bec59d3144dd7222e08cae1a9 100644 (file)
@@ -1,16 +1,4 @@
-#ifndef SLIDER_DECIBELS_H
-#define SLIDER_DECIBELS_H
-#include "slider.qc"
-CLASS(XonoticDecibelsSlider, XonoticSlider)
-       METHOD(XonoticDecibelsSlider, loadCvars, void(entity));
-       METHOD(XonoticDecibelsSlider, saveCvars, void(entity));
-       METHOD(XonoticDecibelsSlider, valueToText, string(entity, float));
-ENDCLASS(XonoticDecibelsSlider)
-entity makeXonoticDecibelsSlider_T(float, float, float, string, string);
-entity makeXonoticDecibelsSlider(float, float, float, string);
-#endif
-
-#ifdef IMPLEMENTATION
+#include "slider_decibels.qh"
 
 float toDecibelOfSquare(float f, float mi)
 {
@@ -19,9 +7,9 @@ float toDecibelOfSquare(float f, float mi)
        {
                // linear scale part
                float t = 1 / A + mi;
-               float y = exp(1 + A * mi);
-               if(f <= y)
-                       return mi + (t - mi) * (f / y);
+               float u = exp(1 + A * mi);
+               if(f <= u)
+                       return mi + (t - mi) * (f / u);
        }
        return log(f) / A;
 }
@@ -33,9 +21,9 @@ float fromDecibelOfSquare(float f, float mi)
        {
                // linear scale part
                float t = 1 / A + mi;
-               float y = exp(1 + A * mi);
+               float u = exp(1 + A * mi);
                if(f <= t)
-                       return y * ((f - mi) / (t - mi));
+                       return u * ((f - mi) / (t - mi));
        }
        return exp(A * f);
 }
@@ -109,5 +97,3 @@ TEST(XonoticDecibelsSlider, SoundTest)
        }
        SUCCEED();
 }
-
-#endif