diff options
Diffstat (limited to 'src/animation_system.cpp')
-rw-r--r-- | src/animation_system.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/animation_system.cpp b/src/animation_system.cpp index cf34066..997b7f7 100644 --- a/src/animation_system.cpp +++ b/src/animation_system.cpp | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "vector.h" | 6 | #include "vector.h" |
7 | #include "util.h" | 7 | #include "util.h" |
8 | 8 | ||
9 | void AnimationSystem::initSprite(int spriteId, std::string_view filename, Renderer& renderer) { | 9 | void AnimationSystem::initSprite(int spriteId, std::string_view filename) { |
10 | std::ifstream datafile(filename.data()); | 10 | std::ifstream datafile(filename.data()); |
11 | if (!datafile.is_open()) { | 11 | if (!datafile.is_open()) { |
12 | throw std::invalid_argument(std::string("Could not find sprite datafile: ") + std::string(filename)); | 12 | throw std::invalid_argument(std::string("Could not find sprite datafile: ") + std::string(filename)); |
@@ -18,9 +18,7 @@ void AnimationSystem::initSprite(int spriteId, std::string_view filename, Render | |||
18 | char ch; | 18 | char ch; |
19 | std::string line; | 19 | std::string line; |
20 | 20 | ||
21 | std::string imagename; | 21 | datafile >> sprite.spritesheet; |
22 | datafile >> imagename; | ||
23 | sprite.textureId = renderer.loadImageFromFile(imagename); | ||
24 | 22 | ||
25 | std::string framefilename; | 23 | std::string framefilename; |
26 | datafile >> framefilename; | 24 | datafile >> framefilename; |