diff options
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(); |