aboutsummaryrefslogtreecommitdiff
path: root/gui/themes/scummtheme.py
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-09-24 13:55:54 +0200
committerWillem Jan Palenstijn2013-09-24 13:55:54 +0200
commit6417192584873f98737a0928adefeb9aa9cad894 (patch)
tree0d238f05c406ae70fff8c907bd10d29a16f2d6a4 /gui/themes/scummtheme.py
parentf3514534ce46bad5e3ffadfdf0b3af403045e5ef (diff)
parent74cc4aec8aa80da2541857e3120b31a566ccdff3 (diff)
downloadscummvm-rg350-6417192584873f98737a0928adefeb9aa9cad894.tar.gz
scummvm-rg350-6417192584873f98737a0928adefeb9aa9cad894.tar.bz2
scummvm-rg350-6417192584873f98737a0928adefeb9aa9cad894.zip
Merge branch 'master' into zvision
Conflicts: video/avi_decoder.cpp
Diffstat (limited to 'gui/themes/scummtheme.py')
-rwxr-xr-xgui/themes/scummtheme.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/gui/themes/scummtheme.py b/gui/themes/scummtheme.py
index 4c55fd79de..524e91468e 100755
--- a/gui/themes/scummtheme.py
+++ b/gui/themes/scummtheme.py
@@ -37,9 +37,13 @@ def parseSTX(theme_file, def_file):
comm = re.compile("<!--(.*?)-->", re.DOTALL)
head = re.compile("<\?(.*?)\?>")
+ strlitcount = 0
output = ""
for line in theme_file:
- output += line.rstrip("\r\n\t ").lstrip() + " \n"
+ output += line.rstrip("\r\n\t ").lstrip()
+ if not output.endswith('>'):
+ output += ' '
+ output += "\n"
output = re.sub(comm, "", output)
output = re.sub(head, "", output)
@@ -48,7 +52,9 @@ def parseSTX(theme_file, def_file):
for line in output.splitlines():
if line and not line.isspace():
+ strlitcount += len(line)
def_file.write("\"" + line + "\"\n")
+ return strlitcount
def buildDefTheme(themeName):
def_file = open("default.inc", "w")
@@ -57,16 +63,23 @@ def buildDefTheme(themeName):
print ("Cannot open default theme dir.")
def_file.write(""" "<?xml version = '1.0'?>"\n""")
+ strlitcount = 24
for filename in os.listdir(themeName):
filename = os.path.join(themeName, filename)
if os.path.isfile(filename) and filename.endswith(".stx"):
theme_file = open(filename, "r")
- parseSTX(theme_file, def_file)
+ strlitcount += parseSTX(theme_file, def_file)
theme_file.close()
def_file.close()
+ if strlitcount > 65535:
+ print("WARNING: default.inc string literal is of length %d which exceeds the" % strlitcount)
+ print(" maximum length of 65536 that C++ compilers are required to support.")
+ print(" It is likely that bugs will occur dependent on compiler behaviour.")
+ print(" To avoid this, reduce the size of the theme.")
+
def printUsage():
print ("===============================")
print ("ScummVM Theme Generation Script")