load_bsp module

This commit is contained in:
Quaternions 2023-10-02 15:28:57 -07:00
parent 96f8360292
commit 7f8c977642
2 changed files with 18 additions and 1 deletions

16
src/load_bsp.rs Normal file
View File

@ -0,0 +1,16 @@
pub fn generate_indexed_models<R:std::io::Read+std::io::Seek>(input:R) -> crate::model::IndexedModelInstances{
let mut spawn_point=glam::Vec3::ZERO;
let mut indexed_models=Vec::new();
match bsp::Bsp::read(input){
Ok(guac)=>println!("we got the guac {:?}", guac),
Err(e)=>println!("rotten {:?}",e),
}
crate::model::IndexedModelInstances{
textures:Vec::new(),
models:indexed_models,
spawn_point,
}
}

View File

@ -14,6 +14,7 @@ mod settings;
mod framework;
mod primitives;
mod instruction;
mod load_bsp;
mod load_roblox;
struct Entity {
@ -878,7 +879,7 @@ impl framework::Example for GlobalState {
},
}
},
//b"VBSP"=>Some(load_bsp::generate_indexed_models(input)),
b"VBSP"=>Some(load_bsp::generate_indexed_models(input)),
//b"SNFM"=>Some(sniffer::generate_indexed_models(input)),
//b"SNFB"=>Some(sniffer::load_bot(input)),
other=>{