summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/map.cpp b/src/map.cpp
index c810fab6..39b73091 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -25,14 +25,10 @@
#include "map.h"
#include "log.h"
#include "being.h"
-#include <queue>
-#include <stdio.h>
-#ifdef WIN32
-#include <windows.h>
-#else
-#include "./net/win2linux.h"
-#endif
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <queue>
Map tiledMap;
@@ -103,11 +99,12 @@ Map::~Map()
delete[] tiles;
}
-bool Map::load(char *mapFile) {
- FILE *file = fopen(mapFile, "r");
+bool Map::load(const std::string &mapFile)
+{
+ FILE *file = fopen(mapFile.c_str(), "r");
if (!file) {
- warning(mapFile);
+ warning(mapFile.c_str());
return false;
}
@@ -149,6 +146,20 @@ bool Map::load(char *mapFile) {
return true;
}
+bool loadXmlMap(const std::string &mapFile)
+{
+ xmlDocPtr doc = xmlReadFile(mapFile.c_str(), NULL, 0);
+
+ if (!doc) {
+ warning(mapFile.c_str());
+ return false;
+ }
+
+ xmlFreeDoc(doc);
+
+ return false;
+}
+
void Map::setSize(int width, int height)
{
this->width = width;