#!/usr/bin/env python3 """Dump the MAP chunk of a level WAD. map_dump.py level.wad [--strats] [--tiles] [--lights] [--check] """ import os import struct import sys sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import wadtool # noqa: E402 import mapchunk as M # noqa: E402 FX = 4096.0 def load(path): ch = dict((t.strip(), c) for t, c in wadtool.read(path)) wf = struct.unpack('= 0 else [] print(f'S{i:3d} code@{code:#x} pos=({x / FX:7.2f},{y / FX:6.2f},{z / FX:7.2f}) ' f'rot=({rx},{ry},{rz}) params={[hex(p) for p in prm]} rest={s[9:]}') if __name__ == '__main__': main()