Added CZ version changing to batch

This commit is contained in:
G2-Games 2024-05-25 12:54:46 -05:00
parent 3126dcb951
commit dc6b832b74

View file

@ -204,6 +204,18 @@ fn main() {
cz.set_bitmap(repl_img.into_raw()); cz.set_bitmap(repl_img.into_raw());
cz.remove_palette(); cz.remove_palette();
if let Some(ver) = version {
match cz.header_mut().set_version(*ver) {
Ok(_) => (),
Err(_) => {
Error::raw(
ErrorKind::ValueValidation,
format!("Invalid CZ Version {}; expected 0, 1, 2, 3, or 4\n", ver)
).exit()
},
};
}
cz.save_as_cz(&final_path).unwrap(); cz.save_as_cz(&final_path).unwrap();
} }
} else { } else {