mirror of
https://github.com/freedoom/freedoom.git
synced 2025-09-01 13:25:46 -04:00
lookup patch defs from arg-supplied file
This commit is contained in:
parent
d05542456e
commit
723b59ddd2
1 changed files with 14 additions and 1 deletions
|
@ -27,14 +27,27 @@ for line in texture1.split("\n"):
|
|||
|
||||
oldtex = file("../../textures/combined.txt", "r").read()
|
||||
patches = []
|
||||
texline = ''
|
||||
for line in oldtex.split("\n"):
|
||||
# start of a patch line
|
||||
if len(line) > 0 and line[0] == "*":
|
||||
patches.append(line)
|
||||
else:
|
||||
# end of a texture definition and we had just one patch
|
||||
if 1 == len(patches):
|
||||
print patches[0]
|
||||
patches = []
|
||||
patches = []
|
||||
texline = ''
|
||||
# end of a texture definition,look up the patches
|
||||
elif texline != '':
|
||||
bits = texline.split()
|
||||
if bits[0] in textures:
|
||||
texture = textures[bits[0]]
|
||||
print '\n'.join(map(str,texture.patches))
|
||||
texline = ''
|
||||
else:
|
||||
sys.stderr.write("uh oh, no idea of patches for %s"%bits[0])
|
||||
|
||||
# start of a texture definition
|
||||
if re.match(r'^[A-Z]', line):
|
||||
texline = line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue