https://github.com/bjt0/rs_wad
A Rust library for loading .WAD files (Doom, Quake, etc)
https://github.com/bjt0/rs_wad
doom quake rust rust-library wad
Last synced: about 1 year ago
JSON representation
A Rust library for loading .WAD files (Doom, Quake, etc)
- Host: GitHub
- URL: https://github.com/bjt0/rs_wad
- Owner: bjt0
- License: gpl-3.0
- Created: 2018-10-01T00:44:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-06T23:19:05.000Z (about 4 years ago)
- Last Synced: 2024-11-18T11:41:57.157Z (over 1 year ago)
- Topics: doom, quake, rust, rust-library, wad
- Language: Rust
- Size: 1.06 MB
- Stars: 11
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-quake - rs_wad - Rust library for loading `.wad` files. (Miscellaneous / QuakeWorld)
README
# Introduction
A Rust library for loading .WAD files (Doom, Quake, etc)
## Features
* Load a WAD archive from a filepath or Rust File
* Access the archive entries by index or name
* All raw data in the archive is loaded internally
## Quick Start
### Load WAD file from a path and then get the first lump in the wad
let w: Wad = Wad::from_path("./wads/MYWAD.wad");
// this returns an option depending on whether there is a lump at index 0
let first_entry = w.get_at_index(0).unwrap();
#### Get a WAD entry by name or index
// same as get_at_index method, but depends on whether a lump with the given name exists
let e1m1_entry = w.get_by_name("E1M1").unwrap();
#### Get raw lump data
let e1m1_entry = w.get_by_name("E1M1").unwrap();
// the E1M1 lump is what is known as a marker
// it signifies the start of the Doom map E1M1 (Hangar in DOOM.WAD)
// all the map data is contained in subsequent lumps, such as the THINGS lump
// as such, this lump will be 0 length
assert_eq!(e1m1_entry.lump().name(), "E1M1");
assert_eq!(e1m1_entry.lump().data().len(), 0);