Crates.io | genie-drs |
lib.rs | genie-drs |
version | 0.2.1 |
source | src |
created_at | 2019-04-09 08:22:18.713552 |
updated_at | 2020-05-18 10:02:57.596244 |
description | Read .drs archive files from the Genie Engine, used in Age of Empires 1/2 and SWGB |
homepage | https://github.com/SiegeEngineers/genie-rs |
repository | https://github.com/SiegeEngineers/genie-rs |
max_upload_size | |
id | 126781 |
size | 64,393 |
.drs is the resource archive file format for the Genie Engine, used by Age of Empires 1/2 and Star Wars: Galactic Battlegrounds. .drs files contain tables, each of which contain resources of a single type. Resources are identified by a numeric identifier.
This crate only supports reading files right now.
Add to Cargo.toml:
[dependencies]
genie-drs = "^0.1.1"
use std::fs::File;
use genie_drs::DRSReader;
let mut file = File::open("test.drs")?;
let drs = DRSReader::new(&mut file)?;
for table in drs.tables() {
for resource in table.resources() {
let content = drs.read_resource(&mut file, table.resource_type, resource.id)?;
println!("{}: {:?}", resource.id, std::str::from_utf8(&content)?);
}
}
read_resource
API, using memmap probably.