summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp2
-rw-r--r--src/map.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp
index e7eebbe6..d7dd7c80 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -36,7 +36,6 @@
#include "gui/npc.h"
#include "gui/stats.h"
#include "gui/ok_dialog.h"
-#include "resources/mapreader.h"
#include "net/protocol.h"
#include <SDL.h>
#include <sstream>
@@ -127,7 +126,6 @@ void game() {
void do_init()
{
tiledMap = Map::load(map_path);
- //tiledMap = MapReader::readMap("core/maps/tempdesert.tmx.gz");
if (!tiledMap) {
error("Could not find map file");
}
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) {