summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-25 19:07:14 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-25 19:07:14 +0200
commite94d56765ffc8d2479b7955b9e00ffbb6f8e0304 (patch)
tree6df5403e54c902c1f3ad831031ca63097d12cbcc
parent77a4432581baed14124d0efe11cf0baf49ed487e (diff)
downloadevol-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-xtestxml/testxml.py15
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)