summary refs log tree commit diff stats
path: root/src/animation_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation_system.cpp')
-rw-r--r--src/animation_system.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/animation_system.cpp b/src/animation_system.cpp index a280aee..2c2c6a5 100644 --- a/src/animation_system.cpp +++ b/src/animation_system.cpp
@@ -78,8 +78,6 @@ void AnimationSystem::initSprite(int spriteId, std::string_view filename) {
78 78
79 if (animName.back() == '!') { 79 if (animName.back() == '!') {
80 anim.looping = false; 80 anim.looping = false;
81 } else if (animName.back() == '.') {
82 anim.manual = true;
83 } 81 }
84 82
85 int animId = sprite.animations.size(); 83 int animId = sprite.animations.size();
@@ -114,19 +112,6 @@ void AnimationSystem::tick(double dt) {
114 } 112 }
115} 113}
116 114
117void AnimationSystem::advanceAnimation(int spriteId) {
118 Sprite& sprite = game_.getSprite(spriteId);
119 Animation& animation = sprite.animations[sprite.animationId];
120
121 if (animation.manual) {
122 sprite.animationFrame++;
123
124 if (sprite.animationFrame >= animation.frameIndices.size()) {
125 sprite.animationFrame = 0;
126 }
127 }
128}
129
130void AnimationSystem::setSpriteDirection(int spriteId, Direction dir) { 115void AnimationSystem::setSpriteDirection(int spriteId, Direction dir) {
131 Sprite& sprite = game_.getSprite(spriteId); 116 Sprite& sprite = game_.getSprite(spriteId);
132 if (sprite.dir != dir) { 117 if (sprite.dir != dir) {