Changeset 3787 in orxonox.OLD for orxonox/branches
- Timestamp:
- Apr 13, 2005, 2:32:26 AM (20 years ago)
- Location:
- orxonox/branches/textEngine/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/animation.cc
r3786 r3787 34 34 // setting default values 35 35 this->localTime = 0.0; 36 this->bRunning = true; 36 37 this->animFunc = &Anim::linear; 37 38 this->currentKeyFrame = tmpKeyFrame; -
orxonox/branches/textEngine/src/animation.h
r3786 r3787 35 35 ANIM_SINE, 36 36 ANIM_RANDOM}; 37 37 38 typedef enum ANIM_INFINITY {ANIM_INF_CONSTANT, 38 39 ANIM_INF_LINEAR, … … 79 80 80 81 bool bHasKeys; 81 bool b Play;82 bool bRunning; 82 83 83 84 float localTime; … … 139 140 void Animation<T>::tick(float time) 140 141 { 141 this->localTime += time; 142 if (localTime >= this->currentKeyFrame->duration) 142 if (this->bRunning) 143 143 { 144 this->localTime = 0; 145 this->currentKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame); 146 this->nextKeyFrame = this->keyFrameList->nextElement(this->nextKeyFrame); 147 printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value); 148 149 144 this->localTime += time; 145 if (localTime >= this->currentKeyFrame->duration) 146 { 147 this->localTime = 0; 148 if (this->currentKeyFrame == this->keyFrameList->lastElement()) 149 switch (this->postInfinity) 150 { 151 case ANIM_INF_CONSTANT: 152 this->bRunning = false; 153 break; 154 case ANIM_INF_REWIND: 155 break; 156 } 157 this->currentKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame); 158 this->nextKeyFrame = this->keyFrameList->nextElement(this->nextKeyFrame); 159 printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value); 160 161 162 } 163 164 (this->object->*(funcToAnim))((this->*animFunc)(this->localTime)); 150 165 } 151 152 (this->object->*(funcToAnim))((this->*animFunc)(this->localTime));153 166 } 154 167 -
orxonox/branches/textEngine/src/lib/util/list.h
r3681 r3787 107 107 void destroy(); 108 108 T* firstElement(); 109 T* lastElement(); 109 110 bool isEmpty(); 110 111 int getSize(); … … 217 218 } 218 219 220 template<class T> 221 T* tList<T>::lastElement() 222 { 223 return this->last->curr; 224 } 225 219 226 220 227 template<class T> -
orxonox/branches/textEngine/src/story_entities/world.cc
r3786 r3787 365 365 tmpAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR); 366 366 tmpAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR); 367 tmpAnim->setInfinity(ANIM_INF_CONSTANT, ANIM_INF_REWIND); 367 368 break; 368 369 }
Note: See TracChangeset
for help on using the changeset viewer.