Mercurial > touhou
comparison examples/eclrenderer.rs @ 665:965ecdbf0316
Make rank user-defined in eclrenderer.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 11 Aug 2019 20:14:20 +0200 |
parents | f08e8e3c6196 |
children | cdb484115c5b |
comparison
equal
deleted
inserted
replaced
664:f08e8e3c6196 | 665:965ecdbf0316 |
---|---|
89 } | 89 } |
90 | 90 |
91 fn main() { | 91 fn main() { |
92 // Parse arguments. | 92 // Parse arguments. |
93 let args: Vec<_> = env::args().collect(); | 93 let args: Vec<_> = env::args().collect(); |
94 if args.len() != 5 { | 94 if args.len() != 6 { |
95 eprintln!("Usage: {} <ECL file> <sub number> <ANM file> <PNG file>", args[0]); | 95 eprintln!("Usage: {} <ECL file> <ANM file> <PNG file> <easy|normal|hard|lunatic> <sub number>", args[0]); |
96 return; | 96 return; |
97 } | 97 } |
98 let ecl_filename = &args[1]; | 98 let ecl_filename = &args[1]; |
99 let sub: u8 = args[2].parse().expect("number"); | 99 let anm_filename = &args[2]; |
100 let anm_filename = &args[3]; | 100 let png_filename = &args[3]; |
101 let png_filename = &args[4]; | 101 let rank: Rank = args[4].parse().expect("rank"); |
102 let sub: u8 = args[5].parse().expect("number"); | |
102 | 103 |
103 // Open the ECL file. | 104 // Open the ECL file. |
104 let file = File::open(ecl_filename).unwrap(); | 105 let file = File::open(ecl_filename).unwrap(); |
105 let mut file = BufReader::new(file); | 106 let mut file = BufReader::new(file); |
106 let mut buf = vec![]; | 107 let mut buf = vec![]; |