# UDMF fixtures (tools/fixtures.py). Freedoom has no UDMF maps, so Freedoom MAP01 (BSD, licenses/freedoom-COPYING.txt; # the nix freedoom package, cut down as in wad.py) is converted here to a "Doom"-namespace TEXTMAP by the UDMF 1.1 # conversion rules (tag -> id and arg0, flag bits -> booleans). The test checks that the TEXTMAP map gives the same # tables and the same Scene geometry as the binary lumps. Plus a hand-written ZDoom-namespace room (comments, octal / # hex, escapes, user_ and unknown keys, an unknown block) with exact areas. # tests/gen/udmf.luau { binary = , textmap = , text = , room = } import importlib.util, os, struct HERE = os.path.dirname(os.path.abspath(__file__)) def wadgen(): spec = importlib.util.spec_from_file_location("_wadfx", os.path.join(HERE, "wad.py")) m = importlib.util.module_from_spec(spec) spec.loader.exec_module(m) return m def q(s): return '"' + s.replace("\\", "\\\\").replace('"', '\\"') + '"' def to_udmf(d): out = ['namespace = "Doom";', ""] nm = lambda b: b.split(b"\0")[0].decode("latin1") for i in range(0, len(d["THINGS"]), 10): x, y, a, t, f = struct.unpack_from("