diff options
-rwxr-xr-x | mapcache/maptool.py | 7 | ||||
-rw-r--r-- | 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 @@ -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} |