diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-09 22:28:27 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-09 22:28:27 -0500 |
commit | 5931470800c43260f600303d1231dbaf586f26fc (patch) | |
tree | aaaa30ee6bae81c1badc8b70d2fbdce33a058d5a /src/animation_system.cpp | |
parent | 315ca2fb388f790791c9ce372cf44e00d51e0e7f (diff) | |
download | tanetane-5931470800c43260f600303d1231dbaf586f26fc.tar.gz tanetane-5931470800c43260f600303d1231dbaf586f26fc.tar.bz2 tanetane-5931470800c43260f600303d1231dbaf586f26fc.zip |
Map changing!
Also removed some dependencies on the Renderer. More changes need to be made. Fading to black before the change would be good. And making sure the characters are facing the right direction. Maybe that code shouldn't live in Game, either. Later we also want to combine the tilesets for these two maps (and any others that are on Tanetane).
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; |