clean up wad.rs comments

gui-branch
an 2019-03-31 15:04:18 -04:00
parent 07f08752d1
commit 023519ad0a
2 changed files with 25 additions and 46 deletions

View File

@ -132,7 +132,6 @@ fn process_ppm(opt: &Options, b: &[u8]) -> ResultS<()>
fn main() -> ResultS<()>
{
use argparse::*;
use memmap::Mmap;
let mut opt: Options = Default::default();
{
@ -221,7 +220,7 @@ fn main() -> ResultS<()>
};
let fp = fs::File::open(fna)?;
let mm = unsafe {Mmap::map(&fp)?};
let mm = unsafe {memmap::Mmap::map(&fp)?};
let b = &mm[machdr::try_mac_header(&mm)..];
match typ {

View File

@ -51,7 +51,7 @@ pub fn read_chunks(b: &[u8], old_dat: bool, siz_cnk: usize)
b"PRpx" => Chunk::Prpx(rd_array(data, phy::read_prpx)?),
b"PXpx" => Chunk::Pxpx(rd_array(data, phy::read_pxpx)?),
b"WPpx" => Chunk::Wppx(rd_array(data, phy::read_wppx)?),
_ => Chunk::Data{iden, data: data.to_vec()},
_ => Chunk::Data{iden, data: data.to_vec()},
});
p = end;
@ -142,51 +142,31 @@ pub fn read_wad(b: &[u8]) -> ResultS<Wad>
#[derive(Debug, Eq, PartialEq)]
pub enum Chunk
{
/// A `PICT` chunk.
Pict(image::Image8),
/// A `Minf` chunk.
Minf(map::Minf),
/// An `iidx` chunk.
Iidx(Vec<u16>),
/// A `PNTS` chunk.
Pnts(Vec<map::Point>),
/// A `LINS` chunk.
Lins(Vec<map::Line>),
/// A `SIDS` chunk.
Sids(Vec<map::Side>),
/// A `POLY` chunk.
Poly(Vec<map::Polygon>),
/// A `LITE` chunk.
Lite(Vec<map::Light>),
/// An `OBJS` chunk.
Objs(Vec<map::Object>),
/// A `plac` chunk.
Plac(Vec<map::ObjectFreq>),
/// An `ambi` chunk.
Ambi(Vec<map::SoundAmbi>),
/// A `bonk` chunk.
Bonk(Vec<map::SoundRand>),
/// A `medi` chunk.
Medi(Vec<map::Media>),
/// A `plat` chunk.
Plat(Vec<map::Platform>),
/// A `NOTE` chunk.
Note(Vec<map::Note>),
/// A `term` chunk.
Term(Vec<trm::Terminal>),
/// A `FXpx` chunk.
Fxpx(Vec<phy::Effect>),
/// A `MNpx` chunk.
Mnpx(Vec<phy::Monster>),
/// A `PRpx` chunk.
Prpx(Vec<phy::Projectile>),
/// A `PXpx` chunk.
Pxpx(Vec<phy::Physics>),
/// A `WPpx` chunk.
Wppx(Vec<phy::Weapon>),
/** A `PICT` chunk. */ Pict(image::Image8),
/** A `Minf` chunk. */ Minf(map::Minf),
/** An `iidx` chunk. */ Iidx(Vec<u16>),
/** A `PNTS` chunk. */ Pnts(Vec<map::Point>),
/** A `LINS` chunk. */ Lins(Vec<map::Line>),
/** A `SIDS` chunk. */ Sids(Vec<map::Side>),
/** A `POLY` chunk. */ Poly(Vec<map::Polygon>),
/** A `LITE` chunk. */ Lite(Vec<map::Light>),
/** An `OBJS` chunk. */ Objs(Vec<map::Object>),
/** A `plac` chunk. */ Plac(Vec<map::ObjectFreq>),
/** An `ambi` chunk. */ Ambi(Vec<map::SoundAmbi>),
/** A `bonk` chunk. */ Bonk(Vec<map::SoundRand>),
/** A `medi` chunk. */ Medi(Vec<map::Media>),
/** A `plat` chunk. */ Plat(Vec<map::Platform>),
/** A `NOTE` chunk. */ Note(Vec<map::Note>),
/** A `term` chunk. */ Term(Vec<trm::Terminal>),
/** A `FXpx` chunk. */ Fxpx(Vec<phy::Effect>),
/** A `MNpx` chunk. */ Mnpx(Vec<phy::Monster>),
/** A `PRpx` chunk. */ Prpx(Vec<phy::Projectile>),
/** A `PXpx` chunk. */ Pxpx(Vec<phy::Physics>),
/** A `WPpx` chunk. */ Wppx(Vec<phy::Weapon>),
/// Any other type of chunk, which may have arbitrary data in it.
Data{/** The name of the chunk. */ iden: Ident,
/** The data. */ data: Vec<u8>},
/** The data. */ data: Vec<u8>},
}
/// An entry containing chunks and application-specific data.