fn main() {
    generate_textures(vec!["caketops", "exterior", "interiors", "slices"]);
}

fn generate_textures(names: Vec<&str>) {
    let vqenc_cmd = format!("{}/utils/vqenc/vqenc", std::env::var("KOS_BASE").unwrap());

    for texname in names {
        let jpgfile = format!("assets/{}.jpg", texname);
        let vqfile = format!("assets/{}.vq", texname);
        let outfile = format!("{}/{}.vq", std::env::var("OUT_DIR").unwrap(), texname);
        std::process::Command::new(&vqenc_cmd)
            .args(["-t", "-v", &jpgfile])
            .output()
            .expect("vqenc on {&vqfile} failed!");
        let _ = std::fs::rename(&vqfile, &outfile);
    }
}
