Skip to content

Repository files navigation

@hypercrab2000/doom-wad-core

Vanilla Doom IWAD/PWAD parser with GZDoom-parity export for lumps, maps, and PLAYPAL-rasterized assets.

Features

  • Full WAD directory parse (loadWadFromArrayBuffer)
  • Texture (TEXTURE1+2), flat, sprite, music, sound inventories
  • Headless patch/flat/texture rasterization using PLAYPAL
  • GZSTATE v1 export and byte-level parity comparison vs GZDoom -dumpgzstate

Install

npm install @hypercrab2000/doom-wad-core

GitHub Packages (until published to npmjs):

echo "@hypercrab2000:registry=https://npm.pkg.github.com" >> ~/.npmrc
npm install @hypercrab2000/doom-wad-core

Usage

import fs from 'node:fs';
import {
  loadWadFromArrayBuffer,
  rasterizePatch,
  rasterizeFlat,
  exportToGzstate,
} from '@hypercrab2000/doom-wad-core';

const wad = loadWadFromArrayBuffer(fs.readFileSync('DOOM.WAD').buffer);
const patch = rasterizePatch(wad.lumpHash.WALL00_1!, wad.playpal);
const gzstate = exportToGzstate(wad, 'E1M1');

Development

npm install
npm run sync   # copy latest from ../doom-wad-lab
npm test
npm run build

Parity tests

Integration tests compare export against GZDoom fixtures in test/fixtures/. Regenerate fixtures from doom-wad-lab using tools/gzrender-v2/dump-gzdoom-state.sh.

Full 68-map corpus gate runs in doom-wad-lab: npm run test:corpus.

Documentation: docs/TESTING.md · workspace ../docs/TESTING.md

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages