move main.rs to leela/main.rs

png-branch
an 2019-02-22 20:35:07 -05:00
parent e18385c524
commit d4be08c9e5
2 changed files with 26 additions and 2 deletions

View File

@ -27,3 +27,11 @@ opt-level = 1
[profile.release]
codegen-units = 1
lto = true
[lib]
name = "maraiah"
path = "src/lib.rs"
[[bin]]
name = "leela"
path = "src/leela/main.rs"

View File

@ -43,7 +43,7 @@ fn dump_chunk(opt: &Options, cid: Ident, cnk: &[u8], eid: u16) -> ResultS<()>
make_chunk(opt, cid, cnk, eid)?;
}
if opt.wad_chunks.contains(&cid) {
if opt.wad_wrt_all || opt.wad_chunks.contains(&cid) {
match &cid {
b"PICT" => {
let im = pict::load_pict(cnk)?;
@ -68,7 +68,11 @@ fn dump_chunk(opt: &Options, cid: Ident, cnk: &[u8], eid: u16) -> ResultS<()>
b"PRpx" => make_yaml(opt, &rd_array(cnk, phy::read_prpx)?)?,
b"PXpx" => make_yaml(opt, &rd_array(cnk, phy::read_pxpx)?)?,
b"WPpx" => make_yaml(opt, &rd_array(cnk, phy::read_wppx)?)?,
_ => (),
_ => {
if opt.wad_unknown && !opt.wad_all {
make_chunk(opt, cid, cnk, eid)?;
}
}
}
}
@ -246,6 +250,16 @@ fn main() -> ResultS<()>
StoreTrue,
"wad: Dump all chunks into a folder");
arg!("--wad-write-all",
opt.wad_wrt_all,
StoreTrue,
"wad: Dump all known chunks");
arg!("--wad-dump-unknown",
opt.wad_unknown,
StoreTrue,
"wad: Dump all unknown chunks");
arg!("--wad-write-header",
opt.wad_header,
StoreTrue,
@ -321,6 +335,8 @@ struct Options
snd_dump: bool,
snd_write: bool,
wad_all: bool,
wad_unknown: bool,
wad_wrt_all: bool,
wad_header: bool,
wad_chunks: HashSet<Ident>,
wad_c_temp: String,