summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-12-05 19:30:53 +0100
committerStefan Dombrowski <stefan@uni-bonn.de>2010-12-05 19:30:53 +0100
commitf622cf4c545033e25fde7f3e1105cdf2118d7016 (patch)
tree2f4a69193a1d37716e8b7fdac1d04b2c1fba6268 /src/resources/mapreader.cpp
parentf2b8d02dc560528f6854a339c1974d761daabc70 (diff)
downloadmana-f622cf4c545033e25fde7f3e1105cdf2118d7016.tar.gz
mana-f622cf4c545033e25fde7f3e1105cdf2118d7016.tar.bz2
mana-f622cf4c545033e25fde7f3e1105cdf2118d7016.tar.xz
mana-f622cf4c545033e25fde7f3e1105cdf2118d7016.zip
Add support for tiles with spacing
Now the map from the Mana server's example data is shown properly. Reviewed-by: Jaxad0127
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index b30bec0a..28feaba8 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -392,6 +392,8 @@ Tileset *MapReader::readTileset(xmlNodePtr node, const std::string &path,
Map *map)
{
int firstGid = XML::getProperty(node, "firstgid", 0);
+ int margin = XML::getProperty(node, "margin", 0);
+ int spacing = XML::getProperty(node, "spacing", 0);
XML::Document* doc = NULL;
Tileset *set = NULL;
std::string pathDir(path);
@@ -426,7 +428,8 @@ Tileset *MapReader::readTileset(xmlNodePtr node, const std::string &path,
if (tilebmp)
{
- set = new Tileset(tilebmp, tw, th, firstGid);
+ set = new Tileset(tilebmp, tw, th, firstGid, margin,
+ spacing);
tilebmp->decRef();
}
else