"""Convert the original GoldSrc additive explosion into a portable PNG atlas. Read-only on the Half-Life installation. No native SPR importer needed at runtime. """ import argparse import hashlib import json import struct from pathlib import Path from PIL import Image ROOT = Path(__file__).resolve().parents[1] def extract(source: Path, destination: Path) -> dict: raw = source.read_bytes() ident, version, orientation, fmt, radius, width, height, count, beam, sync = ( struct.unpack_from('<4siiifiiifi', raw) ) assert (ident, version, fmt) == (b'IDSP', 2, 1), 'Expected GoldSrc additive SPR v2' palette_count = struct.unpack_from('