mirror of
https://github.com/glest/glest-source.git
synced 2025-09-01 20:12:40 +02:00
smoother anim for anim-progress-bound ( better but not perfect :-/ )
This commit is contained in:
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user