archive/vswap (Wolfenstein 3D pages: walls, sprites and sounds through a palette passed in) and vector/gamemaps (GAMEMAPS + MAPHEAD, Carmack + RLEW, into a TileMap); test data from the fixture's own writers
This commit is contained in:
1 parent
719abb97c0
commit
e51fd3585e
15 files changed
+3139
-1085
No files matched your search
@@ -1,10 +1,10 @@
|
||||
# Docs inputs for the id Tech sections of the scene / tilemap / archive pages (tools/fixtures.py; tools/docs_check.py
|
||||
# explains the inputs), made by the format fixtures' writers: the hand-written UDMF room (udmf.py), a dmap-layout
|
||||
# .proc (proc.py).
|
||||
# .proc (proc.py), a VSWAP and a one-map GAMEMAPS + MAPHEAD with a random palette (wolf3d.py).
|
||||
# tests/gen/docs_idtech.luau { files = { [name] = bytes }, vars = { udmfText = "room.udmf", ... } }
|
||||
import importlib.util, os
|
||||
import importlib.util, os, struct
|
||||
|
||||
INPUTS = ["tools/docs_check.py", "tools/fixtures/udmf.py", "tools/fixtures/proc.py"]
|
||||
INPUTS = ["tools/docs_check.py", "tools/fixtures/udmf.py", "tools/fixtures/proc.py", "tools/fixtures/wolf3d.py"]
|
||||
|
||||
|
||||
def mod(ctx, name):
|
||||
@@ -21,5 +21,22 @@ def generate(ctx):
|
||||
models, portals, nodes, areas, shadow = P.level(ctx.rng(2), False)
|
||||
files = {"room.udmf": mod(ctx, "udmf").ROOM.encode(),
|
||||
"level.proc": P.write(models, portals, nodes, areas, shadow, "mapProcFile003", False).encode()}
|
||||
vars = {"udmfText": "room.udmf", "procText": "level.proc"}
|
||||
W = mod(ctx, "wolf3d")
|
||||
rng = ctx.rng(5)
|
||||
pal = bytes(rng.randrange(64) for _ in range(768))
|
||||
files["VSWAP.WL6"], _ = W.vswap(rng, pal)
|
||||
files["wolf.pal"] = pal
|
||||
g = W.grid(rng, 16, 16, 0)
|
||||
planes = [W.plane(g), W.plane([0] * 256), W.plane([0] * 256)]
|
||||
body = bytearray(b"TED5v1.0")
|
||||
starts = []
|
||||
for pl in planes:
|
||||
starts.append(len(body))
|
||||
body += pl
|
||||
head = len(body)
|
||||
body += struct.pack("<iiiHHHHH16s", *starts, *(len(pl) for pl in planes), 16, 16, b"Tiny map") + b"!ID!"
|
||||
files["GAMEMAPS.WL6"] = bytes(body)
|
||||
files["MAPHEAD.WL6"] = struct.pack("<H100i", W.TAG, head, *([0] * 99))
|
||||
vars = {"udmfText": "room.udmf", "procText": "level.proc", "vswapBytes": "VSWAP.WL6", "wolfPaletteBytes": "wolf.pal",
|
||||
"gamemapsBytes": "GAMEMAPS.WL6", "mapheadBytes": "MAPHEAD.WL6"}
|
||||
check.emit_inputs(ctx, files, vars)
|
||||
Reference in new issue
Block a user