6 #include "../item/container.qh" 20 this.configureAnimation(
this, obj, objSetter,
time, animDuration, animStart, animEnd);
24 METHOD(
Keyframe, addEasing,
entity(
entity this,
float animDurationTime,
float animEnd,
float(
float,
float,
float,
float) func))
27 this.addAnim(
this, other);
33 if (this.lastChild)
return this.lastChild.startTime + this.lastChild.duration;
39 float maxDura = this.duration;
40 if (this.lastChild) maxDura = maxDura - (this.lastChild.startTime + this.lastChild.duration);
41 float dura = durationTime;
42 if (0 >= dura || dura > maxDura) dura = maxDura;
48 if (this.lastChild)
return this.lastChild.startValue + this.lastChild.delta;
49 else return this.startValue;
54 if (other.parent)
error(
"Can't add already added anim!");
56 if (other.isFinished(other))
error(
"Can't add finished anim!");
64 l.nextSibling =
other;
68 this.currentChild =
other;
72 other.prevSibling = l;
73 other.nextSibling =
NULL;
74 this.lastChild =
other;
77 METHOD(
Keyframe, calcValue,
float(
entity this,
float tickTime,
float animDuration,
float animStartValue,
float animDelta))
79 if (this.currentChild)
80 if (this.currentChild.isFinished(
this.currentChild)) this.currentChild = this.currentChild.nextSibling;
82 if (this.currentChild)
84 this.currentChild.tick(this.currentChild, tickTime);
85 return this.currentChild.value;
88 return animStartValue + animDelta;
entity makeHostedKeyframe(entity obj, void(entity, float) objSetter, float animDuration, float animStart, float animEnd)
entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
float getNewChildDuration(entity this, float durationTime)
#define METHOD(cname, name, prototype)
float getNewChildStart(entity this)
entity makeKeyframe(entity obj, void(entity, float) objSetter, float animDuration, float animStart, float animEnd)
float getNewChildValue(entity this)