mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 10:44:07 +02:00
Updated readme
This commit is contained in:
parent
ecde0ca59d
commit
583ece21f2
1 changed files with 13 additions and 14 deletions
27
readme.md
27
readme.md
|
|
@ -1,18 +1,17 @@
|
||||||
#Example usage
|
#Example usage
|
||||||
|
|
||||||
```extern crate quake3_loader;
|
(Assuming that the pk3 file is unzipped locally)
|
||||||
use std::fs::{File};
|
|
||||||
use std::path::{Path};
|
|
||||||
use std::io::{Read};
|
|
||||||
|
|
||||||
fn main() {
|
extern crate quake3_loader;
|
||||||
let path = Path::new("pak0/maps/q3dm1.bsp");
|
use std::fs::{File};
|
||||||
let mut file = File::open(path).unwrap();
|
use std::path::{Path};
|
||||||
let mut bytes = Vec::new();
|
use std::io::{Read};
|
||||||
file.read_to_end(&mut bytes).unwrap();
|
fn main() {
|
||||||
|
let path = Path::new("pak0/maps/q3dm1.bsp");
|
||||||
|
let mut file = File::open(path).unwrap();
|
||||||
|
let mut bytes = Vec::new();
|
||||||
|
file.read_to_end(&mut bytes).unwrap();
|
||||||
|
let bsp = quake3_loader::read_bsp(bytes);
|
||||||
|
println!("{:?}", bsp);
|
||||||
|
}
|
||||||
|
|
||||||
let bsp = quake3_loader::read_bsp(bytes);
|
|
||||||
|
|
||||||
println!("{:?}", bsp);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue