1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 10:44:07 +02:00
This commit is contained in:
Robin Appelman 2020-06-26 23:10:41 +02:00
commit c1349950a2
2 changed files with 10 additions and 6 deletions

View file

@ -7,13 +7,9 @@ Currently only supports the tf2 version of bsp files, but adding other sourcemod
# Example usage # Example usage
```rust ```rust
extern crate bsp; fn main() -> Result<(), vbsp::BspError> {
use std::fs::File;
fn main() -> std::io::Result<()> {
let data = std::fs::read("maps/cp_steel.bsp")?; let data = std::fs::read("maps/cp_steel.bsp")?;
let bsp = bsp::Bsp::read(&data)?; let bsp = vbsp::Bsp::read(&data)?;
println!("{:?}", bsp); println!("{:?}", bsp);
Ok(()) Ok(())

8
examples/parse.rs Normal file
View file

@ -0,0 +1,8 @@
fn main() -> Result<(), vbsp::BspError> {
let mut args = std::env::args();
let _ = args.next();
let data = std::fs::read(args.next().unwrap())?;
let _ = vbsp::Bsp::read(&data)?;
Ok(())
}