Asset prog
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import sys, os
|
||||
from args import inputAssets
|
||||
from args import inputAssets, args
|
||||
from processasset import processAsset
|
||||
from assethelpers import getBuiltAssetsRelativePath
|
||||
import zipfile
|
||||
|
||||
# Setup headers directory.
|
||||
# setOutputDir(args.output)
|
||||
@@ -10,5 +12,29 @@ from processasset import processAsset
|
||||
# if not os.path.exists(args.output):
|
||||
# os.makedirs(args.output)
|
||||
|
||||
files = []
|
||||
|
||||
for asset in inputAssets:
|
||||
processAsset(asset)
|
||||
asset = processAsset(asset)
|
||||
files.extend(asset['files'])
|
||||
|
||||
# Take assets and add to a zip archive.
|
||||
outputFileName = args.output_file
|
||||
print(f"Creating output file: {outputFileName}")
|
||||
with zipfile.ZipFile(outputFileName, 'w') as zipf:
|
||||
for file in files:
|
||||
relativeOutputPath = getBuiltAssetsRelativePath(file)
|
||||
zipf.write(file, arcname=relativeOutputPath)
|
||||
|
||||
# Finalize build
|
||||
if args.build_type == 'header':
|
||||
print("Error: Header build not implemented yet.")
|
||||
sys.exit(1)
|
||||
|
||||
elif args.build_type == 'wad':
|
||||
# Nothing to do, already created above!
|
||||
pass
|
||||
|
||||
else:
|
||||
print("Error: Unknown build type.")
|
||||
sys.exit(1)
|
Reference in New Issue
Block a user