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
+18
-1
@@ -254,6 +254,22 @@ local named = assert(F.archive.load(mpqBytes, { names = { "war3map.w3e" } }))
|
||||
assert(#named:list() >= 2)
|
||||
```
|
||||
|
||||
Wolfenstein 3D's page file (`VSWAP.WL6`, also `.WL1`, Spear of Destiny's `.SOD` / `.SDM`) loads as an Archive of
|
||||
its pages (`walls/000`, `sprites/000`, `sounds/000`, `soundinfo`). The format module turns walls and sprites into
|
||||
64 x 64 Images and the digitized sounds into Audio. The game's palette is not part of the file (nor redistributable):
|
||||
pass its 768 bytes as `palette` (6-bit VGA values are scaled up); without it the images are grey.
|
||||
|
||||
```luau
|
||||
local Vswap = F.format("vswap")
|
||||
local pages = assert(F.archive.load(vswapBytes, { name = "VSWAP.WL6" }))
|
||||
assert(pages:list()[1].name == "walls/000")
|
||||
local wall = assert(Vswap.image(pages, "wall", 0, { palette = wolfPaletteBytes }))
|
||||
local guard = assert(Vswap.image(pages, "sprite", 0, { palette = wolfPaletteBytes })) -- alpha 0 = hole
|
||||
assert(wall.width == 64 and guard.height == 64)
|
||||
local sound = assert(Vswap.sound(pages, 1)) -- u8 PCM at 7042 Hz, as f32 Audio
|
||||
assert(sound.sampleRate == 7042 and Vswap.sounds(pages) == 2)
|
||||
```
|
||||
|
||||
## Unix, package and disc archives
|
||||
|
||||
### cpio
|
||||
@@ -431,7 +447,8 @@ assert(F.archive.load(out):list()[1].method == "store")
|
||||
| bzip2 (`.bz2`, `.tbz2`) | yes | - | single stream |
|
||||
| Brotli (`.br`) | yes | - | single stream; no magic number, so pass a `.br` name or `format = "br"` |
|
||||
| PAK (`.pak`) | yes | yes | Quake / Quake II / Half-Life (and SiN `SPAK`) |
|
||||
| WAD (`.wad`) | yes | yes | IWAD / PWAD; lumps, graphics, wall textures and maps through `F.format("wad")` |
|
||||
| WAD (`.wad`) | yes | yes | IWAD / PWAD; lumps, graphics, wall textures and maps (binary and UDMF) through `F.format("wad")` |
|
||||
| VSWAP (Wolfenstein 3D `.wl6` / `.wl1` / `.sod` / `.sdm`) | yes | | pages; walls, sprites and sounds through `F.format("vswap")` |
|
||||
| GRP (`.grp`) | yes | yes | Build engine |
|
||||
| VPK (`.vpk`) | yes | yes | versions 1 / 2, multi-part reading, preload bytes; writes one directory file |
|
||||
| MPQ (`.mpq`, `.w3x`, `.sc2map`, ...) | yes | - | versions 1-4 (classic tables), encryption; no Huffman / ADPCM (WAVE) sectors |
|
||||
|
||||
Reference in new issue
Block a user