summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-03-24 21:24:31 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-03-24 21:24:31 +0000
commitb5a9e699b9685e2a7d448171e282fd284754caf1 (patch)
tree4c8787fb30d28ec685bbcbb2ddca962b838a256d /src/resources/mapreader.cpp
parentadf5fb5d45c11a0506d199d2cc672535c8418ce1 (diff)
downloadmana-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.gz
mana-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.bz2
mana-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.xz
mana-b5a9e699b9685e2a7d448171e282fd284754caf1.zip
Logger Implemented. (3/3)
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 7673bf55..38e15945 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -21,6 +21,7 @@
* $Id$
*/
+#include "../main.h"
#include "mapreader.h"
#include "../log.h"
#include "resourcemanager.h"
@@ -55,25 +56,25 @@ int Tileset::getFirstGid()
Map *MapReader::readMap(const std::string &filename)
{
- log("Attempting to parse XML map data");
+ logger.log("Attempting to parse XML map data");
std::string name = std::string("data/") + filename;
xmlDocPtr doc = xmlParseFile(name.c_str());
if (doc) {
- log("Looking for root node");
+ logger.log("Looking for root node");
xmlNodePtr node = xmlDocGetRootElement(doc);
if (!node || !xmlStrEqual(node->name, BAD_CAST "map")) {
- log("Warning: No map file (%s)!", filename.c_str());
+ logger.log("Warning: No map file (%s)!", filename.c_str());
return NULL;
}
- log("Loading map from XML tree");
+ logger.log("Loading map from XML tree");
return readMap(node, filename);
xmlFreeDoc(doc);
} else {
- log("Error while parsing map file (%s)!", filename.c_str());
+ logger.log("Error while parsing map file (%s)!", filename.c_str());
}
return NULL;
@@ -108,7 +109,7 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path)
}
else if (xmlStrEqual(node->name, BAD_CAST "layer"))
{
- log("- Loading layer %d", layerNr);
+ logger.log("- Loading layer %d", layerNr);
readLayer(node, map, layerNr);
layerNr++;
}
@@ -139,7 +140,7 @@ void MapReader::readLayer(xmlNodePtr node, Map *map, int layer)
xmlFree(encoding);
if (compression) {
- log("Warning: no layer compression supported!");
+ logger.log("Warning: no layer compression supported!");
xmlFree(compression);
return;
}
@@ -217,7 +218,7 @@ Tileset* MapReader::readTileset(
xmlNodePtr node, const std::string &path, Map *map)
{
if (xmlHasProp(node, BAD_CAST "source")) {
- log("Warning: External tilesets not supported yet.");
+ logger.log("Warning: External tilesets not supported yet.");
return NULL;
}
@@ -246,7 +247,7 @@ Tileset* MapReader::readTileset(
return set;
}
else {
- log("Warning: Failed to load tileset (%s)\n", source);
+ logger.log("Warning: Failed to load tileset (%s)\n", source);
}
}