smoother anim for anim-progress-bound ( better but not perfect :-/ )

This commit is contained in:
Titus Tscharntke 2011-07-13 20:54:04 +00:00
parent bc4f33bc9a
commit acca8c118c

View File

@ -1483,17 +1483,22 @@ bool Unit::update() {
progress += (speed * diagonalFactor * heightFactor) / speedDenominator; progress += (speed * diagonalFactor * heightFactor) / speedDenominator;
if(isAnimProgressBound() == true) { if(isAnimProgressBound() == true) {
float targetProgress=0;
if(currSkill->getClass() == scBeBuilt) { if(currSkill->getClass() == scBeBuilt) {
animProgress = this->getHpRatio(); targetProgress = this->getHpRatio();
} }
if(currSkill->getClass() == scProduce) { if(currSkill->getClass() == scProduce) {
animProgress = this->getProgressRatio(); targetProgress = this->getProgressRatio();
} }
if(currSkill->getClass() == scUpgrade) { if(currSkill->getClass() == scUpgrade) {
animProgress = this->getProgressRatio(); targetProgress = this->getProgressRatio();
} }
if(currSkill->getClass() == scMorph) { if(currSkill->getClass() == scMorph) {
animProgress = this->getProgressRatio(); targetProgress = this->getProgressRatio();
}
if(animProgress<targetProgress){
float diff=targetProgress-animProgress;
animProgress=animProgress+diff/(GameConstants::updateFps);
} }
} }
else { else {