Changeset 3821 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Apr 14, 2005, 12:48:30 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/animation_player.cc
r3816 r3821 29 29 30 30 this->animationList = new tList<Anim>(); 31 this->play(); 31 32 } 32 33 … … 111 112 void AnimationPlayer::tick(float timePassed) 112 113 { 113 tIterator<Anim>* animIt = this->animationList->getIterator(); 114 Anim* anim = animIt->nextElement(); 115 while( anim != NULL) 114 if (this->bRunning) 116 115 { 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; 119 125 } 120 delete animIt;121 126 } 127 /** 128 \brief starts playing the AnimationPlayer 129 */ 130 void AnimationPlayer::play(void) 131 { 132 this->bRunning = true; 133 } 134 135 /** 136 \brief pauses playing of the AnimationPlayer 137 */ 138 void AnimationPlayer::pause(void) 139 { 140 this->bRunning = false; 141 } 142 122 143 123 144 -
orxonox/trunk/src/animation_player.h
r3820 r3821 32 32 virtual ~AnimationPlayer(void); 33 33 34 // animation handling 34 35 void addAnimation(Anim* animation); 35 36 void removeAnimation(Anim* animation); 36 37 void flush(void); 37 38 39 // time functions 38 40 void tick(float timePassed); 41 void play(void); 42 void pause(void); 39 43 40 44 void debug(void); … … 46 50 47 51 /* class specific */ 48 tList<Anim>* animationList; //!< A List of Animations to be handled 52 tList<Anim>* animationList; //!< A List of Animations to be handled. 53 bool bRunning; //!< If the AnimationPlayer is running. 49 54 }; 50 55
Note: See TracChangeset
for help on using the changeset viewer.