void SystemView::goToSystem(SystemData* system, bool animate) { setCursor(system); if(!animate) finishAnimation(0); }
void SequenceAnimationComposite::update(Drawable *drawable, long currentTime) { uint16 sequenceSize = _sequence.size(); // Check index bounds if (_index >= sequenceSize) return; // Get the current animation in the sequence AnimationPtr anim = _sequence[_index]; // Update the drawable anim->update(drawable, currentTime); // Check if the current animation is finished if (anim->isFinished()) { // Increase the index - move to the next animation ++_index; if (_index >= sequenceSize) { // Finished the sequence finishAnimation(); } else { // Set the start time for the next animation _sequence[_index]->start(currentTime); } } }
// Increment all Objects in the Manager void AnimationManager::update() { for (int i = 0; i < animationList.size(); i++) { AnimationEntry& entry = animationList[i]; if (!entry.getIgnoreBattery() && (scnManager->skipAnimations || (GLOBAL(settings).disableAnimationsOnBattery && (evtManager->getACPowerStatus() == EventManager::Unplugged)))) { finishAnimation(entry.getObject()); i--; continue; } // If this entry is Started, increment its animation if (entry.getObject()->getAnimationState() == AnimStarted && !entry.isQueued()) { // Increment Animation if (entry.delayComplete()) { entry.getObject()->onAnimTick(); if (!entry.getObject()->isAnimating()) { // No animation is left, finish the animation finishedAnimation(entry); i--; } } } } }
// This function removes all animations form the list void AnimationManager::removeAllAnimations() { AnimationEntry animEntry; // Loop through the animation list and remove all animations for (int i = 0; i < animationList.size(); i++) { animEntry = animationList[i]; finishAnimation(animEntry.getObject()); } animationList.clear(); }
void RepeatAnimationWrapper::update(Drawable* drawable, long currentTime) { // Update wrapped animation _animation->update(drawable, currentTime); // If the animation is finished, increase the repeat count and restart it if needed if (_animation->isFinished()) { ++_repeatCount; if (_timesToRepeat > 0 && _repeatCount >= _timesToRepeat) { finishAnimation(); } else { _animation->start(currentTime); } } }
void OrbitCameraManipulator::setAnimationTime( const double t ) { if( t <= 0. ) { finishAnimation(); m_animation_data = nullptr; return; } if( !m_animation_data ) allocAnimationData(); m_animation_data->_animationTime = t; }
void TranslationAnm::Update(gkScalar time) { if(m_pAnmState->getEnabled()) { m_pAnmState->addTime(time); if(m_pAnmState->getTimePosition() >= (ANM_TIME)) { m_pGameObj->setPosition(m_ToPos+m_AnmPosOffset); m_pGameObj->getNode()->_update(true,false); finishAnimation(); if(m_pAnmListener) { m_pAnmListener->onTranslationAnmFinish(this); } } } }