From 135e71d650e5a414219729cd84a2c917a3e8f1fb Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 24 Feb 2021 10:12:18 -0500 Subject: Removed manual animation stuff --- res/sprites/boney_anim.txt | 4 ++-- res/sprites/duster_anim.txt | 4 ++-- res/sprites/kuma_anim.txt | 4 ++-- res/sprites/lucas_anim.txt | 4 ++-- src/animation_system.cpp | 15 --------------- src/animation_system.h | 3 --- src/character_system.cpp | 2 +- src/sprite.h | 1 - 8 files changed, 9 insertions(+), 28 deletions(-) diff --git a/res/sprites/boney_anim.txt b/res/sprites/boney_anim.txt index 5dfb65f..65901b9 100644 --- a/res/sprites/boney_anim.txt +++ b/res/sprites/boney_anim.txt @@ -48,5 +48,5 @@ barking[up]: 4,36,44,36,44,36,44 barking[up_right]: 5,37,45,37,45,37,45 barking[right]: 6,38,46,38,46,38,46 barking[down_right]: 7,39,47,39,47,39,47 -climb.[up]: 240,241,242,243,244,245,246,247,248,249,250,251,252 -climb.[down]: 253,254,255,256,257,258,259,260,261,262,263,264,265 \ No newline at end of file +climb[up]: 240,241,242,243,244,245,246,247,248,249,250,251,252 +climb[down]: 253,254,255,256,257,258,259,260,261,262,263,264,265 \ No newline at end of file diff --git a/res/sprites/duster_anim.txt b/res/sprites/duster_anim.txt index 538ddd1..9c1ed3f 100644 --- a/res/sprites/duster_anim.txt +++ b/res/sprites/duster_anim.txt @@ -40,5 +40,5 @@ run[up]: 76,84,92,100,108 run[up_right]: 77,85,93,101,109 run[right]: 78,86,94,102,110 run[down_right]: 79,87,95,103,111 -climb.[up]: 200,201,202,206,207,208,203,204,205,206,207,208 -climb.[down]: 200,201,202,206,207,208,203,204,205,206,207,208 \ No newline at end of file +climb[up]: 200,201,202,206,207,208,203,204,205,206,207,208 +climb[down]: 200,201,202,206,207,208,203,204,205,206,207,208 \ No newline at end of file diff --git a/res/sprites/kuma_anim.txt b/res/sprites/kuma_anim.txt index a691b7d..bd56fe6 100644 --- a/res/sprites/kuma_anim.txt +++ b/res/sprites/kuma_anim.txt @@ -48,5 +48,5 @@ talk[up]: 36,44 talk[up_right]: 37,45 talk[right]: 38,46 talk[down_right]: 39,47 -climb.[up]: 257,258,259,263,264,265,260,261,262,263,264,265 -climb.[down]: 257,258,259,263,264,265,260,261,262,263,264,265 \ No newline at end of file +climb[up]: 257,258,259,263,264,265,260,261,262,263,264,265 +climb[down]: 257,258,259,263,264,265,260,261,262,263,264,265 \ No newline at end of file diff --git a/res/sprites/lucas_anim.txt b/res/sprites/lucas_anim.txt index cd5ee9f..3c2906c 100644 --- a/res/sprites/lucas_anim.txt +++ b/res/sprites/lucas_anim.txt @@ -42,5 +42,5 @@ run[right]: 73,81,89,97 run[down_right]: 74,82,90,98 lightning_electrocute![down]: 116,117,118,116,117,118 lightning_collapse![down]: 119,120,121,122 -climb.[up]: 123,124,125,128,127,127,129,130,131,128,127,126 -climb.[down]: 123,124,125,128,127,127,129,130,131,128,127,126 \ No newline at end of file +climb[up]: 123,124,125,128,127,127,129,130,131,128,127,126 +climb[down]: 123,124,125,128,127,127,129,130,131,128,127,126 \ No newline at end of file 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) { if (animName.back() == '!') { anim.looping = false; - } else if (animName.back() == '.') { - anim.manual = true; } int animId = sprite.animations.size(); @@ -114,19 +112,6 @@ void AnimationSystem::tick(double dt) { } } -void AnimationSystem::advanceAnimation(int spriteId) { - Sprite& sprite = game_.getSprite(spriteId); - Animation& animation = sprite.animations[sprite.animationId]; - - if (animation.manual) { - sprite.animationFrame++; - - if (sprite.animationFrame >= animation.frameIndices.size()) { - sprite.animationFrame = 0; - } - } -} - void AnimationSystem::setSpriteDirection(int spriteId, Direction dir) { Sprite& sprite = game_.getSprite(spriteId); if (sprite.dir != dir) { diff --git a/src/animation_system.h b/src/animation_system.h index 8352c19..a116673 100644 --- a/src/animation_system.h +++ b/src/animation_system.h @@ -17,9 +17,6 @@ public: void tick(double dt) override; - // Advances animation by a frame. Only to be used on manual animations. - void advanceAnimation(int spriteId); - void initSprite(int spriteId, std::string_view filename); void setSpriteDirection(int spriteId, Direction dir); diff --git a/src/character_system.cpp b/src/character_system.cpp index 27c2280..ea469d5 100644 --- a/src/character_system.cpp +++ b/src/character_system.cpp @@ -349,7 +349,7 @@ void CharacterSystem::setAnimationFor(int spriteId, CharacterState state) { break; } case CharacterMedium::Ladder: { - game_.getSystem().setSpriteAnimation(spriteId, "climb."); + game_.getSystem().setSpriteAnimation(spriteId, "climb"); if (state == CharacterState::Still || state == CharacterState::Crouching) { sprite.animPaused = true; diff --git a/src/sprite.h b/src/sprite.h index 59d2caf..5750308 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -23,7 +23,6 @@ struct SpriteFrame { struct Animation { bool looping = true; - bool manual = false; std::vector frameIndices; }; -- cgit 1.4.1