diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/animation_system.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/animation_system.cpp b/src/animation_system.cpp index 997b53a..ce5cc02 100644 --- a/src/animation_system.cpp +++ b/src/animation_system.cpp | |||
@@ -43,6 +43,7 @@ void AnimationSystem::initSprite(int spriteId, std::string_view filename) { | |||
43 | std::getline(framefile, line); // frames | 43 | std::getline(framefile, line); // frames |
44 | std::getline(framefile, line); // blank | 44 | std::getline(framefile, line); // blank |
45 | 45 | ||
46 | sprite.frames.clear(); | ||
46 | for (int i=0; i<numFrames; i++) { | 47 | for (int i=0; i<numFrames; i++) { |
47 | SpriteFrame f; | 48 | SpriteFrame f; |
48 | framefile >> f.size.w(); | 49 | framefile >> f.size.w(); |
@@ -64,6 +65,8 @@ void AnimationSystem::initSprite(int spriteId, std::string_view filename) { | |||
64 | 65 | ||
65 | std::string animLine; | 66 | std::string animLine; |
66 | std::getline(datafile, animLine); // blank | 67 | std::getline(datafile, animLine); // blank |
68 | sprite.animations.clear(); | ||
69 | sprite.nameDirToAnim.clear(); | ||
67 | while (std::getline(datafile, animLine)) { | 70 | while (std::getline(datafile, animLine)) { |
68 | std::regex re(R"(([a-z!._]+)\[([a-z_]+)\](%[0-9]+)?: ([0-9,#]+))"); | 71 | std::regex re(R"(([a-z!._]+)\[([a-z_]+)\](%[0-9]+)?: ([0-9,#]+))"); |
69 | std::smatch m; | 72 | std::smatch m; |