move main.rs to leela/main.rs
parent
e18385c524
commit
d4be08c9e5
|
@ -27,3 +27,11 @@ opt-level = 1
|
||||||
[profile.release]
|
[profile.release]
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
lto = true
|
lto = true
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "maraiah"
|
||||||
|
path = "src/lib.rs"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "leela"
|
||||||
|
path = "src/leela/main.rs"
|
||||||
|
|
|
@ -43,7 +43,7 @@ fn dump_chunk(opt: &Options, cid: Ident, cnk: &[u8], eid: u16) -> ResultS<()>
|
||||||
make_chunk(opt, cid, cnk, eid)?;
|
make_chunk(opt, cid, cnk, eid)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if opt.wad_chunks.contains(&cid) {
|
if opt.wad_wrt_all || opt.wad_chunks.contains(&cid) {
|
||||||
match &cid {
|
match &cid {
|
||||||
b"PICT" => {
|
b"PICT" => {
|
||||||
let im = pict::load_pict(cnk)?;
|
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"PRpx" => make_yaml(opt, &rd_array(cnk, phy::read_prpx)?)?,
|
||||||
b"PXpx" => make_yaml(opt, &rd_array(cnk, phy::read_pxpx)?)?,
|
b"PXpx" => make_yaml(opt, &rd_array(cnk, phy::read_pxpx)?)?,
|
||||||
b"WPpx" => make_yaml(opt, &rd_array(cnk, phy::read_wppx)?)?,
|
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,
|
StoreTrue,
|
||||||
"wad: Dump all chunks into a folder");
|
"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",
|
arg!("--wad-write-header",
|
||||||
opt.wad_header,
|
opt.wad_header,
|
||||||
StoreTrue,
|
StoreTrue,
|
||||||
|
@ -321,6 +335,8 @@ struct Options
|
||||||
snd_dump: bool,
|
snd_dump: bool,
|
||||||
snd_write: bool,
|
snd_write: bool,
|
||||||
wad_all: bool,
|
wad_all: bool,
|
||||||
|
wad_unknown: bool,
|
||||||
|
wad_wrt_all: bool,
|
||||||
wad_header: bool,
|
wad_header: bool,
|
||||||
wad_chunks: HashSet<Ident>,
|
wad_chunks: HashSet<Ident>,
|
||||||
wad_c_temp: String,
|
wad_c_temp: String,
|
Loading…
Reference in New Issue