diff options
Diffstat (limited to 'src/ui/util.h')
-rw-r--r-- | src/ui/util.h | 28 |
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 | ||
69 | iDeclareType(Anim) | 69 | iDeclareType(Anim) |
70 | 70 | ||
71 | enum 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 | |||
71 | struct Impl_Anim { | 78 | struct 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 | ||
76 | void init_Anim (iAnim *, float value); | 84 | void init_Anim (iAnim *, float value); |
77 | void setValue_Anim (iAnim *, float to, uint32_t span); | 85 | void setValue_Anim (iAnim *, float to, uint32_t span); |
78 | float value_Anim (const iAnim *); | 86 | void setValueLinear_Anim (iAnim *, float to, uint32_t span); |
79 | iBool isFinished_Anim (const iAnim *); | 87 | void setValueEased_Anim (iAnim *, float to, uint32_t span); |
88 | void setFlags_Anim (iAnim *, int flags, iBool set); | ||
89 | void stop_Anim (iAnim *); | ||
90 | |||
91 | iBool isFinished_Anim (const iAnim *); | ||
92 | float value_Anim (const iAnim *); | ||
93 | |||
94 | iLocalDef float targetValue_Anim(const iAnim *d) { | ||
95 | return d->to; | ||
96 | } | ||
97 | iLocalDef iBool isLinear_Anim(const iAnim *d) { | ||
98 | return (d->flags & (easeIn_AnimFlag | easeOut_AnimFlag)) == 0; | ||
99 | } | ||
80 | 100 | ||
81 | /*-----------------------------------------------------------------------------------------------*/ | 101 | /*-----------------------------------------------------------------------------------------------*/ |
82 | 102 | ||