18 lines
402 B
C
18 lines
402 B
C
#include "engineAnimation.h"
|
|
|
|
void UpdateAnimation(Animation *animation, float deltaTime) {
|
|
animation->animTimer += deltaTime;
|
|
float frameTime = 1.0f / animation->framesSpeed;
|
|
|
|
if (animation->animTimer < frameTime) {
|
|
return;
|
|
}
|
|
|
|
animation->animTimer -= frameTime;
|
|
animation->currentFrame++;
|
|
|
|
if (animation->currentFrame >= animation->maxFrame) {
|
|
animation->currentFrame = 0;
|
|
}
|
|
}
|