comparison examples/anmrenderer.rs @ 701:b6c351ca0a35

anm0: return the nom IResult and the list of Anm0s.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 23 Aug 2019 15:34:03 +0200
parents ccb739c5b66c
children 84af5bedbde4
comparison
equal deleted inserted replaced
700:ccb739c5b66c 701:b6c351ca0a35
106 let png_filename = &args[2]; 106 let png_filename = &args[2];
107 let script: u8 = args[3].parse().expect("number"); 107 let script: u8 = args[3].parse().expect("number");
108 108
109 // Open the ANM file. 109 // Open the ANM file.
110 let buf = load_file_into_vec(anm_filename); 110 let buf = load_file_into_vec(anm_filename);
111 let anm0 = Anm0::from_slice(&buf).unwrap(); 111 let (_, mut anms) = Anm0::from_slice(&buf).unwrap();
112 let anm0 = anms.pop().unwrap();
112 113
113 if !anm0.scripts.contains_key(&script) { 114 if !anm0.scripts.contains_key(&script) {
114 eprintln!("This anm0 doesn’t contain a script named {}.", script); 115 eprintln!("This anm0 doesn’t contain a script named {}.", script);
115 return; 116 return;
116 } 117 }