diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-01-25 19:07:14 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-01-25 19:07:14 +0200 |
commit | e94d56765ffc8d2479b7955b9e00ffbb6f8e0304 (patch) | |
tree | 6df5403e54c902c1f3ad831031ca63097d12cbcc | |
parent | 77a4432581baed14124d0efe11cf0baf49ed487e (diff) | |
download | evol-tools-e94d56765ffc8d2479b7955b9e00ffbb6f8e0304.tar.gz evol-tools-e94d56765ffc8d2479b7955b9e00ffbb6f8e0304.tar.bz2 evol-tools-e94d56765ffc8d2479b7955b9e00ffbb6f8e0304.tar.xz evol-tools-e94d56765ffc8d2479b7955b9e00ffbb6f8e0304.zip |
textxml: add more checks for variant/variants.
-rwxr-xr-x | testxml/testxml.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py index 3a9c793..65a306d 100755 --- a/testxml/testxml.py +++ b/testxml/testxml.py @@ -336,6 +336,16 @@ def testSpriteFile(id, fullPath, file, fileLoc, dnum, variant, iserr): if len(dom.childNodes) < 1: return + try: + variants = dom.attributes["variants"].value + except: + variants = 0 + + try: + variant_offset = dom.attributes["variant_offset"].value + except: + variant_offset = 0 + root = dom.childNodes[0]; imagesets = dom.getElementsByTagName("imageset") if imagesets is None or len(imagesets) < 1: @@ -391,6 +401,11 @@ def testSpriteFile(id, fullPath, file, fileLoc, dnum, variant, iserr): " (need " + str(s2) + ") is not multiply to frame size " + height + ", image:" + image, False) num = (s1 / int(width)) * (s2 / int(height)) + if variants == 0 and variant > 0: + showMsgSprite(fileLoc, "missing variants attribute in sprite", iserr) + if variants > 0 and variant >= variants: + showMsgSprite(fileLoc, "variant number more then in variants attribute", iserr) + if variant >= num: showMsgSprite(fileLoc, "to big variant number " + str(variant) \ + ". Frames number " + str(num) + ", id=" + str(id), iserr) |