diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-12 00:33:19 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-12 00:33:19 -0500 |
commit | 5ecd0f428dd8292a17c5013c525a4f5d3967acb8 (patch) | |
tree | 0068b66a1183f822909f115a142fae3869a3b09f /src/map.cpp | |
parent | 19be2ac58b09c5240a32e6a4f41cd9f6cda03d07 (diff) | |
download | tanetane-5ecd0f428dd8292a17c5013c525a4f5d3967acb8.tar.gz tanetane-5ecd0f428dd8292a17c5013c525a4f5d3967acb8.tar.bz2 tanetane-5ecd0f428dd8292a17c5013c525a4f5d3967acb8.zip |
Scripts are organised per-map now
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map.cpp b/src/map.cpp index 99711c6..8d4aa2d 100644 --- a/src/map.cpp +++ b/src/map.cpp | |||
@@ -5,10 +5,11 @@ | |||
5 | #include <tmxlite/TileLayer.hpp> | 5 | #include <tmxlite/TileLayer.hpp> |
6 | #include <tmxlite/Tileset.hpp> | 6 | #include <tmxlite/Tileset.hpp> |
7 | 7 | ||
8 | Map::Map(std::string_view filename) : filename_(filename) { | 8 | Map::Map(std::string_view name) : name_(name) { |
9 | std::string filename = "../res/maps/" + std::string(name) + ".tmx"; | ||
9 | tmx::Map mapfile; | 10 | tmx::Map mapfile; |
10 | if (!mapfile.load(filename.data())) { | 11 | if (!mapfile.load(filename.c_str())) { |
11 | throw std::invalid_argument("Could not find map file: " + std::string(filename)); | 12 | throw std::invalid_argument("Could not find map file: " + filename); |
12 | } | 13 | } |
13 | 14 | ||
14 | const tmx::Vector2u& mapSize = mapfile.getTileCount(); | 15 | const tmx::Vector2u& mapSize = mapfile.getTileCount(); |