diff options
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r-- | src/resources/mapreader.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index fd04f015f..57524e953 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -192,10 +192,7 @@ Map *MapReader::readMap(const std::string &filename, Map *map = nullptr; if (!buffer) - { - logger->log("Map file not found (%s)", realFilename.c_str()); - return nullptr; - } + return createEmptyMap(filename, realFilename); unsigned char *inflated; unsigned int inflatedSize; @@ -792,3 +789,16 @@ Tileset *MapReader::readTileset(XmlNodePtr node, const std::string &path, return set; } + +Map *MapReader::createEmptyMap(const std::string &filename, + const std::string &realFilename) +{ + logger->log("Creating empty map"); + Map *map = new Map(300, 300, 32, 32); + MapLayer *layer = new MapLayer(0, 0, 300, 300, false); + map->addLayer(layer); + layer = new MapLayer(0, 0, 300, 300, true); + map->addLayer(layer); + + return map; +} |