2023-10-02 22:28:57 +00:00
|
|
|
|
2024-01-09 01:31:51 +00:00
|
|
|
pub fn generate_indexed_models<R:std::io::Read+std::io::Seek>(input:&mut R)->Result<crate::model::IndexedModelInstances,vbsp::BspError>{
|
2023-10-10 04:37:07 +00:00
|
|
|
let mut s=Vec::new();
|
|
|
|
|
|
|
|
match input.read_to_end(&mut s){
|
2024-01-09 01:31:51 +00:00
|
|
|
Ok(_)=>(),
|
|
|
|
Err(e)=>println!("load_bsp::generate_indexed_models read_to_end failed: {:?}",e),
|
2023-10-10 04:37:07 +00:00
|
|
|
}
|
|
|
|
|
2024-01-09 01:31:51 +00:00
|
|
|
|
2023-10-10 04:37:07 +00:00
|
|
|
match vbsp::Bsp::read(s.as_slice()){
|
2024-01-09 01:31:51 +00:00
|
|
|
Ok(bsp)=>{
|
|
|
|
let mut spawn_point=crate::integer::Planar64Vec3::ZERO;
|
2023-10-02 22:28:57 +00:00
|
|
|
|
2024-01-09 01:31:51 +00:00
|
|
|
let mut indexed_models=Vec::new();
|
|
|
|
Ok(crate::model::IndexedModelInstances{
|
|
|
|
textures:Vec::new(),
|
|
|
|
models:indexed_models,
|
|
|
|
spawn_point,
|
|
|
|
modes:Vec::new(),
|
|
|
|
})
|
|
|
|
},
|
|
|
|
Err(e)=>{
|
|
|
|
println!("rotten {:?}",e);
|
|
|
|
Err(e)
|
|
|
|
},
|
2023-10-02 22:28:57 +00:00
|
|
|
}
|
|
|
|
}
|