]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fixed several warnings
authorStephan Stahl <esteel@eos.franken.de>
Sun, 16 May 2010 13:04:41 +0000 (13:04 +0000)
committerStephan Stahl <esteel@eos.franken.de>
Sun, 16 May 2010 13:04:41 +0000 (13:04 +0000)
qcsrc/menu/anim/animation.c
qcsrc/menu/anim/easing.c
qcsrc/menu/anim/keyframe.c
qcsrc/menu/item/listbox.c
qcsrc/menu/xonotic/util.qc

index 4aacb27244d5541609769faf0f029c9338cd75a9..1019fdacb3ec706b25c45b5734e7c081bcb85493 100644 (file)
@@ -27,11 +27,11 @@ void setterDummy(entity, float);
 #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)
@@ -64,22 +64,22 @@ void setObjectSetterAnimation(entity me, entity o, void(entity, float) s)
        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)
@@ -108,7 +108,7 @@ void finishAnimAnimation(entity me)
        me.finished = TRUE;
 }
 
-void setterDummy(entity object, float value)
+void setterDummy(entity obj, float objValue)
 {
 }
 
index 2c82f81e78675df5eabfdf70060b7149e14aa72e..f14a4be0a602625b3d1dae98e3579f5bc553cc1f 100644 (file)
@@ -13,26 +13,26 @@ float easingQuadInOut(float, float, float, float);
 #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)
@@ -40,32 +40,32 @@ 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));
        }
 }
 
index d32f19618454dd655c9cc87b51bab9303e3c0cb3..95fbf63ccefe5b15d5acc6a019db25a868d2fedf 100644 (file)
@@ -15,26 +15,26 @@ float getNewChildValue(entity);
 #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;
 }
@@ -92,7 +92,7 @@ void addAnimKeyframe(entity me, entity 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))
@@ -100,10 +100,10 @@ float calcValueKeyframe(entity me, float time, float duration, float startValue,
 
        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
index a0493482081d3d03e4775fa9a2a988bd2499a979..d85b1d5285084566dae9598a08565312cd45bfd0 100644 (file)
@@ -106,9 +106,9 @@ float mouseDragListBox(entity me, vector pos)
                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;
index 0492760bfd66780a50b6d9cabe2f351e6b9182fa..3571e1ba834c6b47c5c9cb7392f9e071ee9289ec 100644 (file)
@@ -332,7 +332,6 @@ void postMenuDraw()
        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);
        }
 }