From d53fc948fa92df30bcef465e07f9fca43b8fbfd7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Sep 2014 15:27:59 +0300 Subject: mapcache: fix to tmx conversion. Add empty fringe layer. --- mapcache/maptool.py | 7 +++++-- mapcache/templates/template.tmx | 5 +++++ 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 @@ -10,6 +10,11 @@ {2} + + + + +{4} -- cgit v1.2.3-70-g09d2