-#include "../../warpzonelib/mathlib.qh"
-
-#ifdef INTERFACE
-CLASS(XonoticDecibelsSlider) EXTENDS(XonoticSlider)
- METHOD(XonoticDecibelsSlider, loadCvars, void(entity))
- METHOD(XonoticDecibelsSlider, saveCvars, void(entity))
- METHOD(XonoticDecibelsSlider, valueToText, string(entity, float))
+#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(float, float, float, string);
#endif
entity makeXonoticDecibelsSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
{
entity me;
- me = spawnXonoticDecibelsSlider();
+ me = NEW(XonoticDecibelsSlider);
me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
return me;
}
// snapping
if(v > fromDecibelOfSquare(me.valueMax - 0.5 * me.valueStep, me.valueMin))
- Slider_setValue(me, me.valueMax);
+ Slider_setValue_noAnim(me, me.valueMax);
else
- Slider_setValue(me, me.valueStep * floor(0.5 + toDecibelOfSquare(v, me.valueMin) / me.valueStep) );
+ Slider_setValue_noAnim(me, me.valueStep * floor(0.5 + toDecibelOfSquare(v, me.valueMin) / me.valueStep));
}
void XonoticDecibelsSlider_saveCvars(entity me)
{
float v = fromDecibelOfSquare(db, -40);
float dbv = toDecibelOfSquare(v, -40);
float d = dbv - db;
- printf("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
+ LOG_INFOF("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
TEST_Check(fabs(d) > 0.02);
}
TEST_OK();