summaryrefslogtreecommitdiff
path: root/testxml
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-30 21:57:52 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-30 21:57:52 +0300
commit848b2baaf39ab467e78bf67bc8506b59125f209d (patch)
tree70408128e8fa26223cb09d532b6a9e102c459aaa /testxml
parentfeda89180d09c8d6f8e22f83980dc5083b468fc1 (diff)
downloadevol-tools-848b2baaf39ab467e78bf67bc8506b59125f209d.tar.gz
evol-tools-848b2baaf39ab467e78bf67bc8506b59125f209d.tar.bz2
evol-tools-848b2baaf39ab467e78bf67bc8506b59125f209d.tar.xz
evol-tools-848b2baaf39ab467e78bf67bc8506b59125f209d.zip
testxml: add checking for overlaped tilesets.
Diffstat (limited to 'testxml')
-rwxr-xr-xtestxml/testxml.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py
index b7bde6f..5acbfa6 100755
--- a/testxml/testxml.py
+++ b/testxml/testxml.py
@@ -1211,6 +1211,7 @@ def testMap(file, path):
tilesMap[tile.firstGid] = tile
+ testTiles(file, tilesMap)
layers = dom.getElementsByTagName("layer")
if layers == None or len(layers) == 0:
showMsgFile(file, "map dont have layers", True)
@@ -1300,6 +1301,20 @@ def testMap(file, path):
showLayerErrors(file, err1, "empty tile in all layers", True)
+def testTiles(file, tilesMap):
+ for firstGid in tilesMap:
+ for gid2 in tilesMap:
+ if firstGid != gid2:
+ tile1 = tilesMap[firstGid]
+ tile2 = tilesMap[gid2]
+ if (tile1.firstGid >= tile2.firstGid and tile1.firstGid <= tile2.lastGid) or \
+ (tile1.lastGid >= tile2.firstGid and tile1.lastGid <= tile2.lastGid):
+ showMsgFile(file, "overlaping tilesets gids \"" + tile1.name \
+ + "\" and \"" + tile2.name + "\"", True)
+
+
+
+
def reportAboutTiles(file, data):
if testBadCollisions == False:
return