From 5ecd0f428dd8292a17c5013c525a4f5d3967acb8 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 12 Feb 2021 00:33:19 -0500 Subject: Scripts are organised per-map now --- src/map.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/map.cpp') 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 @@ #include #include -Map::Map(std::string_view filename) : filename_(filename) { +Map::Map(std::string_view name) : name_(name) { + std::string filename = "../res/maps/" + std::string(name) + ".tmx"; tmx::Map mapfile; - if (!mapfile.load(filename.data())) { - throw std::invalid_argument("Could not find map file: " + std::string(filename)); + if (!mapfile.load(filename.c_str())) { + throw std::invalid_argument("Could not find map file: " + filename); } const tmx::Vector2u& mapSize = mapfile.getTileCount(); -- cgit 1.4.1