mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +02:00
examples
This commit is contained in:
parent
5e859b00f0
commit
c1349950a2
2 changed files with 10 additions and 6 deletions
|
|
@ -7,13 +7,9 @@ Currently only supports the tf2 version of bsp files, but adding other sourcemod
|
|||
# Example usage
|
||||
|
||||
```rust
|
||||
extern crate bsp;
|
||||
|
||||
use std::fs::File;
|
||||
|
||||
fn main() -> std::io::Result<()> {
|
||||
fn main() -> Result<(), vbsp::BspError> {
|
||||
let data = std::fs::read("maps/cp_steel.bsp")?;
|
||||
let bsp = bsp::Bsp::read(&data)?;
|
||||
let bsp = vbsp::Bsp::read(&data)?;
|
||||
println!("{:?}", bsp);
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
8
examples/parse.rs
Normal file
8
examples/parse.rs
Normal 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(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue