summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-03 15:27:59 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-03 15:27:59 +0300
commitd53fc948fa92df30bcef465e07f9fca43b8fbfd7 (patch)
tree856b7879054563f3bbb21450b67cd4f4ab6d3879
parentee4f2984a63e73940d6d729a9ffe3211dc3b68ad (diff)
downloadevol-tools-d53fc948fa92df30bcef465e07f9fca43b8fbfd7.tar.gz
evol-tools-d53fc948fa92df30bcef465e07f9fca43b8fbfd7.tar.bz2
evol-tools-d53fc948fa92df30bcef465e07f9fca43b8fbfd7.tar.xz
evol-tools-d53fc948fa92df30bcef465e07f9fca43b8fbfd7.zip
mapcache: fix to tmx conversion.
Add empty fringe layer.
-rwxr-xr-xmapcache/maptool.py7
-rw-r--r--mapcache/templates/template.tmx5
2 files changed, 10 insertions, 2 deletions
diff --git a/mapcache/maptool.py b/mapcache/maptool.py
index b145044..375a25d 100755
--- a/mapcache/maptool.py
+++ b/mapcache/maptool.py
@@ -134,18 +134,21 @@ def covertToTmx(f, mapsCount):
mapData = dc.decompress(mapData)
ground = ""
collision = ""
+ fringe = ""
for y in xrange(0, sy):
for x in xrange(0, sx):
tile = getTile(mapData, x, y, sx)
- if x + 1 == sy and y + 1 == sy:
+ if x + 1 == sx and y + 1 == sy:
ground = ground + getGroundTile(tile)
collision = collision + getCollisionTile(tile)
+ fringe = fringe + "0";
else:
ground = ground + getGroundTile(tile) + ","
collision = collision + getCollisionTile(tile) + ","
+ fringe = fringe + "0,";
ground = ground + "\n"
collision = collision + "\n"
- saveFile(mapsDir + name + ".tmx", tmx.format(sx, sy, ground, collision))
+ saveFile(mapsDir + name + ".tmx", tmx.format(sx, sy, ground, collision, fringe))
def readMapCache(path, cmd):
if cmd == "help":
diff --git a/mapcache/templates/template.tmx b/mapcache/templates/template.tmx
index 78a319f..40d8d14 100644
--- a/mapcache/templates/template.tmx
+++ b/mapcache/templates/template.tmx
@@ -12,6 +12,11 @@
{2}
</data>
</layer>
+ <layer name="Fringe" width="{0}" height="{1}">
+ <data encoding="csv">
+{4}
+</data>
+ </layer>
<layer name="Collision" width="{0}" height="{1}">
<data encoding="csv">
{3}