From: Stephan Stahl Date: Sun, 16 May 2010 13:04:41 +0000 (+0000) Subject: fixed several warnings X-Git-Tag: xonotic-v0.1.0preview~606^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8da3bbc7349e9daebfe59337d652f0be61193490;p=xonotic%2Fxonotic-data.pk3dir.git fixed several warnings --- diff --git a/qcsrc/menu/anim/animation.c b/qcsrc/menu/anim/animation.c index 4aacb2724..1019fdacb 100644 --- a/qcsrc/menu/anim/animation.c +++ b/qcsrc/menu/anim/animation.c @@ -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) { } diff --git a/qcsrc/menu/anim/easing.c b/qcsrc/menu/anim/easing.c index 2c82f81e7..f14a4be0a 100644 --- a/qcsrc/menu/anim/easing.c +++ b/qcsrc/menu/anim/easing.c @@ -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)); } } diff --git a/qcsrc/menu/anim/keyframe.c b/qcsrc/menu/anim/keyframe.c index d32f19618..95fbf63cc 100644 --- a/qcsrc/menu/anim/keyframe.c +++ b/qcsrc/menu/anim/keyframe.c @@ -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 diff --git a/qcsrc/menu/item/listbox.c b/qcsrc/menu/item/listbox.c index a04934820..d85b1d528 100644 --- a/qcsrc/menu/item/listbox.c +++ b/qcsrc/menu/item/listbox.c @@ -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; diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 0492760bf..3571e1ba8 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -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); } }