pub struct Parser<'a, Reader: Seek + Read> { /* private fields */ }
Expand description
WAD parser. Wraps a mutable reference to a Read + Seek cursor to provide random read access.
Implementations§
Source§impl<'a, Reader: Seek + Read> Parser<'a, Reader>
impl<'a, Reader: Seek + Read> Parser<'a, Reader>
Sourcepub fn new(cursor: &'a mut Reader) -> BinParseResult<(Self, Vec<String>)>
pub fn new(cursor: &'a mut Reader) -> BinParseResult<(Self, Vec<String>)>
Constructs a new wad parser starting at the provided cursor. May produce a list of warnings for duplicate entriess (entries sharing the same name).
Sourcepub fn directory(&self) -> HashMap<String, Entry>
pub fn directory(&self) -> HashMap<String, Entry>
Clones WAD entries into a hash map. Entries are used to access lumps within the WAD.
Sourcepub fn parse_mip_texture(&mut self, entry: &Entry) -> BinParseResult<MipTexture>
pub fn parse_mip_texture(&mut self, entry: &Entry) -> BinParseResult<MipTexture>
Attempts to parse a mip-mapped texture at the offset provided by the entry
Sourcepub fn parse_image(&mut self, entry: &Entry) -> BinParseResult<Image>
pub fn parse_image(&mut self, entry: &Entry) -> BinParseResult<Image>
Attempts to parse a 2D at the offset provided by the entry
Sourcepub fn parse_palette(&mut self, entry: &Entry) -> BinParseResult<Box<Palette>>
pub fn parse_palette(&mut self, entry: &Entry) -> BinParseResult<Box<Palette>>
Attempts to parse a 768 byte palette at the offset provided by the entry
Sourcepub fn read_raw(&mut self, entry: &Entry) -> BinParseResult<Box<[u8]>>
pub fn read_raw(&mut self, entry: &Entry) -> BinParseResult<Box<[u8]>>
Attempts to read a number of bytes using the provided entry’s length and offset
Sourcepub fn parse_inferred(&mut self, entry: &Entry) -> BinParseResult<Lump>
pub fn parse_inferred(&mut self, entry: &Entry) -> BinParseResult<Lump>
Attempts to read a lump based on the provided entry’s name and lump kind. All known kinds of lump are attempted based on the entry. E.g. there is a special case where Quake’s gfx.wad has a flat lump named CONCHARS which is erroneously tagged as miptex.