Changeset 4597 in orxonox.OLD for orxonox/trunk/src/util/animation/animation_player.cc
- Timestamp:
- Jun 11, 2005, 12:55:48 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/animation/animation_player.cc
r4485 r4597 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 26 26 \brief standard constructor 27 27 */ 28 AnimationPlayer::AnimationPlayer () 28 AnimationPlayer::AnimationPlayer () 29 29 { 30 this->setClassID(CL_ANIMATION_PLAYER, "AnimationPlayer"); 30 this->setClassID(CL_ANIMATION_PLAYER, "AnimationPlayer"); 31 this->setName("AnimationPlayer"); 31 32 32 33 33 this->animationList = new tList<Animation>(); 34 this->play(); 34 35 } 35 36 … … 43 44 44 45 !! DANGER !! when unloading the AnimationPlayer no other Function 45 should reference any Animations, from the animationList because it 46 automatically deletes them. 46 should reference any Animations, from the animationList because it 47 automatically deletes them. 47 48 This usually happens when unloading a World. 48 49 */ 49 AnimationPlayer::~AnimationPlayer () 50 AnimationPlayer::~AnimationPlayer () 50 51 { 51 52 // deleting the Animation List AND all the elements of the List … … 61 62 62 63 when adding a Animation the Animation will too be deleted when 63 the AnimationPlayer gets deleted. Consider not adding it, or 64 the AnimationPlayer gets deleted. Consider not adding it, or 64 65 unadding it with animation->notHandled(); 65 66 */ … … 80 81 /** 81 82 \brief empties the list AND deletes all the Animations 82 */ 83 */ 83 84 void AnimationPlayer::flush(void) 84 85 { … … 99 100 100 101 /** 101 \brief Ticks all the animations in animationList 102 \brief Ticks all the animations in animationList 102 103 \param timePassed the time passed since the last tick. 103 104 */ … … 110 111 Animation* anim = animIt->nextElement(); 111 112 while( anim != NULL) 112 113 114 115 116 117 118 119 120 113 { 114 anim->tick(timePassed); 115 if(unlikely(anim->ifDelete())) 116 { 117 this->animationList->remove(anim); 118 delete anim; 119 } 120 anim = animIt->nextElement(); 121 } 121 122 delete animIt; 122 123 } … … 150 151 { 151 152 if(anim->getBaseObject() == baseObject) 152 153 154 155 153 { 154 delete animIt; 155 return anim; 156 } 156 157 anim = animIt->nextElement(); 157 158 }
Note: See TracChangeset
for help on using the changeset viewer.