Palette assets improved.

This commit is contained in:
2025-09-01 20:07:12 -05:00
parent 4541d5219b
commit 3e61d6f84d
18 changed files with 161 additions and 120 deletions

44
tools/assetstool/main.py Normal file
View File

@@ -0,0 +1,44 @@
import sys, os
from args import inputAssets, args
from processasset import processAsset
from processpalette import processPaletteList
from assethelpers import getBuiltAssetsRelativePath
import zipfile
# Setup headers directory.
# setOutputDir(args.output)
# outputHeaders = []
# # Create output directory if it doesn't exist
# if not os.path.exists(args.output):
# os.makedirs(args.output)
files = []
for asset in inputAssets:
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)
# Generate additional headers.
processPaletteList()
# 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)