From 1a40c7b23c068ce6c630a5f9e73e476a9e00b7b1 Mon Sep 17 00:00:00 2001 From: danij Date: Sun, 28 Sep 2014 09:42:43 +0100 Subject: [PATCH] qmake|Resources: Add MAPINFO defs to the game's base data package --- doomsday/build/scripts/packres.py | 38 +++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/doomsday/build/scripts/packres.py b/doomsday/build/scripts/packres.py index 11c8197b11..21818996bf 100755 --- a/doomsday/build/scripts/packres.py +++ b/doomsday/build/scripts/packres.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2.7 # This Python script will create a set of PK3 files that contain the files -# that Doomsday needs at runtime. The PK3 files are organized using the +# that Doomsday needs at runtime. The PK3 files are organized using the # traditional data/ and defs/ structure. import sys, os, os.path, zipfile @@ -15,26 +15,26 @@ if '--quiet' in sys.argv: sys.argv.remove('--quiet') quietMode = True - + deng_dir = os.path.join('..', '..') target_dir = os.path.abspath(sys.argv[1]) class Pack: def __init__(self): - self.files = [] # tuples - + self.files = [] # tuples + def add_files(self, fileNamesArray): self.files += fileNamesArray - + def msg(self, text): if not quietMode: print text - + def create(self, name): full_name = os.path.join(target_dir, name) self.msg("Creating %s as %s..." % (os.path.normpath(name), os.path.normpath(full_name))) - + pk3 = zipfile.ZipFile(full_name, 'w', zipfile.ZIP_DEFLATED) - + for src, dest in self.files: full_src = os.path.join(deng_dir, src) # Is this a file or a folder? @@ -52,14 +52,14 @@ def process_dir(path, dest_path): continue # Ignore these. if os.path.isfile(real_file): if not quietMode: - self.msg("writing %s as %s" % (os.path.normpath(real_file), + self.msg("writing %s as %s" % (os.path.normpath(real_file), os.path.normpath(os.path.join(dest_path, file)))) pk3.write(real_file, os.path.join(dest_path, file)) elif os.path.isdir(real_file): - process_dir(real_file, + process_dir(real_file, os.path.join(dest_path, file)) process_dir(full_src, dest) - + # Write it out. print "Created %s (with %i files)." % (os.path.normpath(full_name), len(pk3.namelist())) pk3.close() @@ -75,6 +75,14 @@ def process_dir(path, dest_path): p = Pack() p.add_files( [ ('plugins/doom/defs', 'defs/jdoom'), + ('plugins/doom/data/chex.mapinfo', 'data/jdoom/chex.mapinfo'), + ('plugins/doom/data/doom1-share.mapinfo', 'data/jdoom/doom1-share.mapinfo'), + ('plugins/doom/data/doom1-ultimate.mapinfo', 'data/jdoom/doom1-ultimate.mapinfo'), + ('plugins/doom/data/doom1.mapinfo', 'data/jdoom/doom1.mapinfo'), + ('plugins/doom/data/doom2-plut.mapinfo', 'data/jdoom/doom2-plut.mapinfo'), + ('plugins/doom/data/doom2-tnt.mapinfo', 'data/jdoom/doom2-tnt.mapinfo'), + ('plugins/doom/data/doom2.mapinfo', 'data/jdoom/doom2.mapinfo'), + ('plugins/doom/data/hacx.mapinfo', 'data/jdoom/hacx.mapinfo'), ('plugins/doom/data/conhelp.txt', 'data/jdoom/conhelp.txt'), ('plugins/doom/data/lumps', '#.basedata') ] ) p.create('libdoom.pk3') @@ -83,6 +91,9 @@ def process_dir(path, dest_path): p = Pack() p.add_files( [ ('plugins/heretic/defs', 'defs/jheretic'), + ('plugins/heretic/data/heretic-ext.mapinfo', 'data/jheretic/heretic-ext.mapinfo'), + ('plugins/heretic/data/heretic-share.mapinfo', 'data/jheretic/heretic-share.mapinfo'), + ('plugins/heretic/data/heretic.mapinfo', 'data/jheretic/heretic.mapinfo'), ('plugins/heretic/data/conhelp.txt', 'data/jheretic/conhelp.txt'), ('plugins/heretic/data/lumps', '#.basedata') ] ) p.create('libheretic.pk3') @@ -91,7 +102,9 @@ def process_dir(path, dest_path): p = Pack() p.add_files( [ ('plugins/hexen/defs', 'defs/jhexen'), - ('plugins/hexen/data/conhelp.txt', 'data/jhexen/conhelp.txt'), + ('plugins/hexen/data/hexen-dk.mapinfo', 'data/jhexen/hexen-dk.mapinfo'), + ('plugins/hexen/data/hexen.mapinfo', 'data/jhexen/hexen.mapinfo'), + ('plugins/hexen/data/conhelp.txt', 'data/jhexen/conhelp.txt'), ('plugins/hexen/data/lumps', '#.basedata') ] ) p.create('libhexen.pk3') @@ -99,6 +112,7 @@ def process_dir(path, dest_path): p = Pack() p.add_files( [ ('plugins/doom64/defs', 'defs/jdoom64'), + ('plugins/doom64/data/doom64.mapinfo', 'data/jdoom64/doom64.mapinfo'), ('plugins/doom64/data/conhelp.txt', 'data/jdoom64/conhelp.txt'), ('plugins/doom64/data/lumps', '#.basedata') ] ) p.create('libdoom64.pk3')