ra2-shp 0.0.3

Parser for Red Alert 2 shape files (*.shp)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Example of working with encrypted RA2 MIX files

use ra2_pal::Palette;
use ra2_shp::shp2apng;
use ra2_types::Ra2Error;
use std::path::Path;

fn main() -> Result<(), Ra2Error> {
    let root = Path::new("E:\\Games\\Red Alert 2 - Yuri's Revenge");
    let file = std::fs::read(root.join("ra2/cache/unittem.pal"))?;
    let pal = Palette::decode(&file)?;
    let shp_path = root.join("ra2/conquer/engineer.shp");
    shp2apng(&shp_path, &pal)?;
    Ok(())
}