A high-performance, native Rust parser for RenderWare files (.dff, .txd, .ifp).
This project is a Rust port of the excellent rw-parser-ng, rewritten from the ground up to leverage Rust's performance and safety. The goal is to provide a significantly faster and more memory-efficient alternative for server-side processing and tooling.
Our benchmarks show that rw-parser-rs is approximately 100x faster than its Node.js counterpart for typical DFF parsing tasks.
- Blazing Fast: Native Rust performance for maximum throughput.
- DFF (Model) Parsing: Extracts geometry, materials, frames, and skinning data.
- TXD (Texture Dictionary) Parsing: Extracts texture information and decompresses DXT formats.
- IFP (Animation) Parsing: Extracts animation data for
ANP3andANPKformats. - Safe & Robust: Built with Rust's safety guarantees to prevent common parsing vulnerabilities.
- Strongly Typed: Ensures data integrity and a great developer experience.
Add rw-parser-rs to your Cargo.toml:
[dependencies]
rw-parser-rs = "1.0.0"use rw_parser_rs::renderware::dff::dff_parser::DffParser;
use std::fs;
fn main() -> std::io::Result<()> {
// DFF
let dff_buffer = fs::read("path/to/your/model.dff")?;
let mut dff_parser = DffParser::new(&dff_buffer);
let dff_data = dff_parser.parse()?;
println!("Successfully parsed DFF model: {}", dff_data.version);
// Similar usage for TxdParser and IfpParser
Ok(())
}- Clone the repository:
git clone https://github.com/DepsCian/rw-parser-rs.git - Build the project:
cargo build --release - Run benchmarks:
cargo bench - Generate documentation:
cargo doc --open
Contributions are welcome! Please feel free to open an issue or submit a pull request.
This project is licensed under the GPL-3.0 License.