#endif
#ifdef IMPLEMENTATION
-void configureAnimationAnimation(entity me, entity obj, void(entity, float) setter, float startTime, float duration, float startValue, float end)
+void configureAnimationAnimation(entity me, entity obj, void(entity, float) objSetter, float animStartTime, float animDuration, float animStartValue, float animEndValue)
{
- me.setObjectSetter(me, obj, setter);
- me.setTimeStartDuration(me, startTime, duration);
- me.setValueStartEnd(me, startValue, end);
+ me.setObjectSetter(me, obj, objSetter);
+ me.setTimeStartDuration(me, animStartTime, animDuration);
+ me.setValueStartEnd(me, animStartValue, animEndValue);
}
void setTimeStartEndAnimation(entity me, float s, float e)
me.setter = s;
}
-void tickAnimation(entity me, float time)
+void tickAnimation(entity me, float tickTime)
{
- if (me.isStopped(me) || me.isFinished(me) || (time < me.startTime))
+ if (me.isStopped(me) || me.isFinished(me) || (tickTime < me.startTime))
return;
- if (time >= (me.startTime + me.duration))
+ if (tickTime >= (me.startTime + me.duration))
me.finishAnim(me);
else
- me.value = me.calcValue(me, (time - me.startTime), me.duration, me.startValue, me.delta);
+ me.value = me.calcValue(me, (tickTime - me.startTime), me.duration, me.startValue, me.delta);
me.setter(me.object, me.value);
}
-float calcValueAnimation(entity me, float time, float duration, float startValue, float delta)
+float calcValueAnimation(entity me, float tickTime, float animDuration, float animStartValue, float animDelta)
{
- return startValue;
+ return animStartValue;
}
float isStoppedAnimation(entity me)
me.finished = TRUE;
}
-void setterDummy(entity object, float value)
+void setterDummy(entity obj, float objValue)
{
}
#endif
#ifdef IMPLEMENTATION
-entity makeHostedEasing(entity obj, void(entity, float) setter, float(float, float, float, float) func, float duration, float startValue, float end)
+entity makeHostedEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animDuration, float animStartValue, float animEnd)
{
entity me;
- me = makeEasing(obj, setter, func, time, duration, startValue, end);
+ me = makeEasing(obj, objSetter, func, time, animDuration, animStartValue, animEnd);
anim.addAnim(anim, me);
return me;
}
-entity makeEasing(entity obj, void(entity, float) setter, float(float, float, float, float) func, float startTime, float duration, float startValue, float end)
+entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
{
entity me;
me = spawnEasing();
- me.configureAnimation(me, obj, setter, startTime, duration, startValue, end);
+ me.configureAnimation(me, obj, objSetter, animStartTime, animDuration, animStartValue, animEnd);
me.setMath(me, func);
return me;
}
-float calcValueEasing(entity me, float time, float duration, float start, float delta)
+float calcValueEasing(entity me, float tickTime, float animDuration, float animStart, float animDelta)
{
- return me.math(time, duration, start, delta);
+ return me.math(tickTime, animDuration, animStart, animDelta);
}
void setMathEasing(entity me, float(float, float, float, float) func)
me.math = func;
}
-float easingLinear(float time, float duration, float start, float delta)
+float easingLinear(float tickTime, float animDuration, float animStart, float animDelta)
{
- return (delta * (time / duration)) + start;
+ return (animDelta * (tickTime / animDuration)) + animStart;
}
-float easingQuadIn(float time, float duration, float start, float delta)
+float easingQuadIn(float tickTime, float animDuration, float animStart, float animDelta)
{
- float frac = time / duration;
- return (delta * frac * frac) + start;
+ float frac = tickTime / animDuration;
+ return (animDelta * frac * frac) + animStart;
}
-float easingQuadOut(float time, float duration, float start, float delta)
+float easingQuadOut(float tickTime, float animDuration, float animStart, float animDelta)
{
- float frac = time / duration;
- return (-delta * frac * (frac - 2)) + start;
+ float frac = tickTime / animDuration;
+ return (-animDelta * frac * (frac - 2)) + animStart;
}
-float easingQuadInOut(float time, float duration, float start, float delta)
+float easingQuadInOut(float tickTime, float animDuration, float animStart, float animDelta)
{
- if (time < (duration / 2))
+ if (tickTime < (animDuration / 2))
{
- return easingQuadIn(time, (duration / 2), start, (delta / 2));
+ return easingQuadIn(tickTime, (animDuration / 2), animStart, (animDelta / 2));
}
else
{
- return easingQuadOut((time - (duration / 2)), (duration / 2), (start + (delta / 2)), (delta / 2));
+ return easingQuadOut((tickTime - (animDuration / 2)), (animDuration / 2), (animStart + (animDelta / 2)), (animDelta / 2));
}
}
#endif
#ifdef IMPLEMENTATION
-entity makeHostedKeyframe(entity obj, void(entity, float) setter, float duration, float start, float end)
+entity makeHostedKeyframe(entity obj, void(entity, float) objSetter, float animDuration, float animStart, float animEnd)
{
entity me;
- me = makeKeyframe(obj, setter, duration, start, end);
+ me = makeKeyframe(obj, objSetter, animDuration, animStart, animEnd);
anim.addAnim(anim, me);
return me;
}
-entity makeKeyframe(entity obj, void(entity, float) setter, float duration, float start, float end)
+entity makeKeyframe(entity obj, void(entity, float) objSetter, float animDuration, float animStart, float animEnd)
{
entity me;
me = spawnKeyframe();
- me.configureAnimation(me, obj, setter, time, duration, start, end);
+ me.configureAnimation(me, obj, objSetter, time, animDuration, animStart, animEnd);
return me;
}
-entity addEasingKeyframe(entity me, float durationTime, float end, float(float, float, float, float) func)
+entity addEasingKeyframe(entity me, float animDurationTime, float animEnd, float(float, float, float, float) func)
{
entity other;
- other = makeEasing(me.object, me.setter, func, getNewChildStart(me), getNewChildDuration(me, durationTime), getNewChildValue(me), end);
+ other = makeEasing(me.object, me.setter, func, getNewChildStart(me), getNewChildDuration(me, animDurationTime), getNewChildValue(me), animEnd);
me.addAnim(me, other);
return other;
}
me.lastChild = other;
}
-float calcValueKeyframe(entity me, float time, float duration, float startValue, float delta)
+float calcValueKeyframe(entity me, float tickTime, float animDuration, float animStartValue, float animDelta)
{
if (me.currentChild)
if (me.currentChild.isFinished(me.currentChild))
if (me.currentChild)
{
- me.currentChild.tick(me.currentChild, time);
+ me.currentChild.tick(me.currentChild, tickTime);
return me.currentChild.value;
}
- return startValue + delta;
+ return animStartValue + animDelta;
}
#endif
if(hit)
{
// calculate new pos to v
- float delta;
- delta = (pos_y - me.pressOffset) / (1 - (me.controlBottom - me.controlTop)) * (me.nItems * me.itemHeight - 1);
- me.scrollPos = me.previousValue + delta;
+ float d;
+ d = (pos_y - me.pressOffset) / (1 - (me.controlBottom - me.controlTop)) * (me.nItems * me.itemHeight - 1);
+ me.scrollPos = me.previousValue + d;
}
else
me.scrollPos = me.previousValue;
if(autocvar_menu_watermark != "")
{
vector fs = '48 48 0';
- float w;
draw_CenterText('0.5 0.1 0', autocvar_menu_watermark, globalToBoxSize('32 32 0', draw_scale), '1 1 1', 0.05, 1);
}
}