]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/anim/animation.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / anim / animation.qc
index 72bcc5e94ec44a294f1b9eaa86b5cad566b0a22d..60741bd6f0b17ab8720c016eae222b4216d93f62 100644 (file)
@@ -2,87 +2,86 @@
 
 #include "../menu.qh"
 
-       METHOD(Animation, configureAnimation, void(entity this, entity obj, void(entity, float) objSetter, float animStartTime, float animDuration, float animStartValue, float animEndValue))
-       {
-               this.setObjectSetter(this, obj, objSetter);
-               this.setTimeStartDuration(this, animStartTime, animDuration);
-               this.setValueStartEnd(this, animStartValue, animEndValue);
-       }
-
-       METHOD(Animation, update, void(entity this, float animDuration, float animStartValue, float animEndValue))
-       {
-               this.setTimeStartDuration(this, time, animDuration);
-               this.setValueStartEnd(this, animStartValue, animEndValue);
-       }
-
-       METHOD(Animation, setTimeStartEnd, void(entity this, float s, float e))
-       {
-               this.startTime = s;
-               this.duration = e - s;
-       }
-
-       METHOD(Animation, setTimeStartDuration, void(entity this, float s, float d))
-       {
-               this.startTime = s;
-               this.duration = d;
-       }
-
-       METHOD(Animation, setValueStartEnd, void(entity this, float s, float e))
-       {
-               this.startValue = s;
-               this.delta = e - s;
-       }
-
-       METHOD(Animation, setValueStartDelta, void(entity this, float s, float d))
-       {
-               this.startValue = s;
-               this.delta = d;
-       }
-
-       METHOD(Animation, setObjectSetter, void(entity this, entity o, void(entity, float) s))
-       {
-               this.object = o;
-               this.setter = s;
-       }
-
-       METHOD(Animation, tick, void(entity this, float tickTime))
-       {
-               if (this.isStopped(this) || this.isFinished(this) || (tickTime < this.startTime)) return;
-
-               if (tickTime >= (this.startTime + this.duration)) this.finishAnim(this);
-               else this.value = this.calcValue(this, (tickTime - this.startTime), this.duration, this.startValue, this.delta);
-
-               this.setter(this.object, this.value);
-       }
-
-       METHOD(Animation, calcValue, float(entity this, float tickTime, float animDuration, float animStartValue, float animDelta))
-       {
-               return animStartValue;
-       }
-
-       METHOD(Animation, isStopped, bool(entity this))
-       {
-               return this.stopped;
-       }
-
-       METHOD(Animation, stopAnim, void(entity this))
-       {
-               this.stopped = true;
-       }
-
-       METHOD(Animation, resumeAnim, void(entity this))
-       {
-               this.stopped = false;
-       }
-
-       METHOD(Animation, isFinished, bool(entity this))
-       {
-               return this.finished;
-       }
-
-       METHOD(Animation, finishAnim, void(entity this))
-       {
-               this.value = this.delta + this.startValue;
-               this.finished = true;
-               this.setter(this.object, this.value);
-       }
+METHOD(Animation, configureAnimation, void(entity this, entity obj, void(entity, float) objSetter, float animStartTime, float animDuration, float animStartValue, float animEndValue))
+{
+       this.setObjectSetter(this, obj, objSetter);
+       this.setTimeStartDuration(this, animStartTime, animDuration);
+       this.setValueStartEnd(this, animStartValue, animEndValue);
+}
+
+METHOD(Animation, update, void(entity this, float animDuration, float animStartValue, float animEndValue))
+{
+       this.setTimeStartDuration(this, time, animDuration);
+       this.setValueStartEnd(this, animStartValue, animEndValue);
+}
+
+METHOD(Animation, setTimeStartEnd, void(entity this, float s, float e))
+{
+       this.startTime = s;
+       this.duration = e - s;
+}
+
+METHOD(Animation, setTimeStartDuration, void(entity this, float s, float d))
+{
+       this.startTime = s;
+       this.duration = d;
+}
+
+METHOD(Animation, setValueStartEnd, void(entity this, float s, float e))
+{
+       this.startValue = s;
+       this.delta = e - s;
+}
+
+METHOD(Animation, setValueStartDelta, void(entity this, float s, float d))
+{
+       this.startValue = s;
+       this.delta = d;
+}
+
+METHOD(Animation, setObjectSetter, void(entity this, entity o, void(entity, float) s))
+{
+       this.object = o;
+       this.setter = s;
+}
+
+METHOD(Animation, tick, void(entity this, float tickTime))
+{
+       if (this.isStopped(this) || this.isFinished(this) || (tickTime < this.startTime)) { return; }
+
+       if (tickTime >= (this.startTime + this.duration)) { this.finishAnim(this); } else { this.value = this.calcValue(this, (tickTime - this.startTime), this.duration, this.startValue, this.delta); }
+
+       this.setter(this.object, this.value);
+}
+
+METHOD(Animation, calcValue, float(entity this, float tickTime, float animDuration, float animStartValue, float animDelta))
+{
+       return animStartValue;
+}
+
+METHOD(Animation, isStopped, bool(entity this))
+{
+       return this.stopped;
+}
+
+METHOD(Animation, stopAnim, void(entity this))
+{
+       this.stopped = true;
+}
+
+METHOD(Animation, resumeAnim, void(entity this))
+{
+       this.stopped = false;
+}
+
+METHOD(Animation, isFinished, bool(entity this))
+{
+       return this.finished;
+}
+
+METHOD(Animation, finishAnim, void(entity this))
+{
+       this.value = this.delta + this.startValue;
+       this.finished = true;
+       this.setter(this.object, this.value);
+}