summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-20 19:32:32 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-20 19:32:32 +0000
commitc93f9d8acd4b01b41afe095bc8391ef498c55eba (patch)
tree2e580486ad1cb6077478964f6a81ca9c8ea9628b /src/map.cpp
parent90e5ce7e958418f0d39d38112d33d3190a78baea (diff)
downloadmana-c93f9d8acd4b01b41afe095bc8391ef498c55eba.tar.gz
mana-c93f9d8acd4b01b41afe095bc8391ef498c55eba.tar.bz2
mana-c93f9d8acd4b01b41afe095bc8391ef498c55eba.tar.xz
mana-c93f9d8acd4b01b41afe095bc8391ef498c55eba.zip
Auto-detect map files in new map format.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 9419233d..e7323b58 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -112,6 +112,12 @@ Map::~Map()
Map *Map::load(const std::string &mapFile)
{
+ if (mapFile.find(".tmx", 0) != std::string::npos)
+ {
+ // New map file format assumed
+ return MapReader::readMap(mapFile);
+ }
+
FILE *file = fopen(mapFile.c_str(), "r");
if (!file) {