Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3821 in orxonox.OLD for orxonox/trunk/src/animation_player.cc


Ignore:
Timestamp:
Apr 14, 2005, 12:48:30 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: pause and play function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/animation_player.cc

    r3816 r3821  
    2929
    3030   this->animationList = new tList<Anim>();
     31   this->play();
    3132}
    3233
     
    111112void AnimationPlayer::tick(float timePassed)
    112113{
    113   tIterator<Anim>* animIt = this->animationList->getIterator();
    114   Anim* anim = animIt->nextElement();
    115   while( anim != NULL)
     114  if (this->bRunning)
    116115    {
    117       anim->tick(timePassed);
    118       anim = animIt->nextElement();
     116      // iterate through all the animations and tick them.
     117      tIterator<Anim>* animIt = this->animationList->getIterator();
     118      Anim* anim = animIt->nextElement();
     119      while( anim != NULL)
     120        {
     121          anim->tick(timePassed);
     122          anim = animIt->nextElement();
     123        }
     124      delete animIt;
    119125    }
    120   delete animIt;
    121126}
     127/**
     128   \brief starts playing the AnimationPlayer
     129*/
     130void AnimationPlayer::play(void)
     131{
     132  this->bRunning = true;
     133}
     134
     135/**
     136   \brief pauses playing of the AnimationPlayer
     137*/
     138void AnimationPlayer::pause(void)
     139{
     140  this->bRunning = false;
     141}
     142
    122143
    123144
Note: See TracChangeset for help on using the changeset viewer.