Asset prog

This commit is contained in:
2025-08-25 10:16:55 -05:00
parent 947f21cac7
commit 8af2f044ed
23 changed files with 290 additions and 31 deletions

View File

@@ -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)