Ejemplo n.º 1
0
void SystemView::goToSystem(SystemData* system, bool animate)
{
	setCursor(system);

	if(!animate)
		finishAnimation(0);
}
Ejemplo n.º 2
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);
		}
	}
}
Ejemplo n.º 3
0
// 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--;
				}
			}
		}
	}
}
Ejemplo n.º 4
0
// 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();
}
Ejemplo n.º 5
0
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;
}
Ejemplo n.º 7
0
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);
            }
        }
    }
}