MCPcopy Create free account
hub / github.com/comaps/comaps / CombineAnimation

Method CombineAnimation

libs/drape_frontend/animation_system.cpp:167–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void AnimationSystem::CombineAnimation(drape_ptr<Animation> && animation)
168{
169#ifdef DEBUG_ANIMATIONS
170 LOG(LINFO, ("Combine animation", animation->GetType()));
171#endif
172 TAnimationList interruptedAnimations;
173 bool startImmediately = true;
174 for (auto & pList : m_animationChain)
175 {
176 auto & lst = *pList;
177 bool couldBeBlended = animation->CouldBeBlended();
178
179 for (auto it = lst.begin(); it != lst.end();)
180 {
181 auto & anim = *it;
182 if (anim->GetInterruptedOnCombine() && anim->HasSameObjects(*animation))
183 {
184#ifdef DEBUG_ANIMATIONS
185 LOG(LINFO, ("Interrupted on combine", anim->GetType()));
186#endif
187 interruptedAnimations.splice(interruptedAnimations.end(), lst, it++);
188 }
189 else if (!anim->CouldBeBlendedWith(*animation))
190 {
191 if (!anim->CouldBeInterrupted())
192 {
193 couldBeBlended = false;
194 break;
195 }
196#ifdef DEBUG_ANIMATIONS
197 LOG(LINFO, ("Couldn't be blended, interrupted", anim->GetType()));
198#endif
199 interruptedAnimations.splice(interruptedAnimations.end(), lst, it++);
200 }
201 else
202 {
203 ++it;
204 }
205 }
206
207 for (auto & anim : interruptedAnimations)
208 {
209 anim->Interrupt();
210 SaveAnimationResult(*anim);
211 }
212
213 if (couldBeBlended)
214 {
215#ifdef DEBUG_ANIMATIONS
216 LOG(LINFO, ("Animation blended"));
217#endif
218 lst.emplace_back(std::move(animation));
219 if (startImmediately)
220 lst.back()->OnStart();
221#ifdef DEBUG_ANIMATIONS
222 Print();
223#endif
224 return;

Callers 5

CreateAnimMethod · 0.80
OnSetScaleMethod · 0.80
SetScreenMethod · 0.80
SetFollowAndRotateMethod · 0.80
EndDragMethod · 0.80

Calls 14

CouldBeBlendedMethod · 0.80
HasSameObjectsMethod · 0.80
CouldBeBlendedWithMethod · 0.80
CouldBeInterruptedMethod · 0.80
backMethod · 0.80
PrintFunction · 0.50
GetTypeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
InterruptMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected