Changeset 3787 in orxonox.OLD for orxonox/branches/textEngine/src/animation.h
- Timestamp:
- Apr 13, 2005, 2:32:26 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.