summaryrefslogtreecommitdiff
path: root/mapcache/maptool.py
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 /mapcache/maptool.py
parentee4f2984a63e73940d6d729a9ffe3211dc3b68ad (diff)
downloadtools-d53fc948fa92df30bcef465e07f9fca43b8fbfd7.tar.gz
tools-d53fc948fa92df30bcef465e07f9fca43b8fbfd7.tar.bz2
tools-d53fc948fa92df30bcef465e07f9fca43b8fbfd7.tar.xz
tools-d53fc948fa92df30bcef465e07f9fca43b8fbfd7.zip
mapcache: fix to tmx conversion.
Add empty fringe layer.
Diffstat (limited to 'mapcache/maptool.py')
-rwxr-xr-xmapcache/maptool.py7
1 files changed, 5 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":