summaryrefslogtreecommitdiff
path: root/src/ui/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/util.h')
-rw-r--r--src/ui/util.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/ui/util.h b/src/ui/util.h
index a33bf713..c342c095 100644
--- a/src/ui/util.h
+++ b/src/ui/util.h
@@ -68,15 +68,35 @@ iLocalDef iBool isOverlapping_Rangei(iRangei a, iRangei b) {
68 68
69iDeclareType(Anim) 69iDeclareType(Anim)
70 70
71enum iAnimFlag {
72 indefinite_AnimFlag = iBit(1), /* does not end; must be linear */
73 easeIn_AnimFlag = iBit(2),
74 easeOut_AnimFlag = iBit(3),
75 easeBoth_AnimFlag = easeIn_AnimFlag | easeOut_AnimFlag,
76};
77
71struct Impl_Anim { 78struct Impl_Anim {
72 float from, to; 79 float from, to;
73 uint32_t when, due; 80 uint32_t when, due;
81 int flags;
74}; 82};
75 83
76void init_Anim (iAnim *, float value); 84void init_Anim (iAnim *, float value);
77void setValue_Anim (iAnim *, float to, uint32_t span); 85void setValue_Anim (iAnim *, float to, uint32_t span);
78float value_Anim (const iAnim *); 86void setValueLinear_Anim (iAnim *, float to, uint32_t span);
79iBool isFinished_Anim (const iAnim *); 87void setValueEased_Anim (iAnim *, float to, uint32_t span);
88void setFlags_Anim (iAnim *, int flags, iBool set);
89void stop_Anim (iAnim *);
90
91iBool isFinished_Anim (const iAnim *);
92float value_Anim (const iAnim *);
93
94iLocalDef float targetValue_Anim(const iAnim *d) {
95 return d->to;
96}
97iLocalDef iBool isLinear_Anim(const iAnim *d) {
98 return (d->flags & (easeIn_AnimFlag | easeOut_AnimFlag)) == 0;
99}
80 100
81/*-----------------------------------------------------------------------------------------------*/ 101/*-----------------------------------------------------------------------------------------------*/
82 102