From 55a1ef0d1418d5bcca1f2f93425696fa8746d8ed Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 15:28:57 -0700 Subject: [PATCH] load_bsp module --- src/load_bsp.rs | 16 ++++++++++++++++ src/main.rs | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/load_bsp.rs diff --git a/src/load_bsp.rs b/src/load_bsp.rs new file mode 100644 index 0000000..b08bb52 --- /dev/null +++ b/src/load_bsp.rs @@ -0,0 +1,16 @@ +pub fn generate_indexed_models(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, + } +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index b780f80..7f99163 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,7 @@ mod zeroes; mod framework; mod primitives; mod instruction; +mod load_bsp; mod load_roblox; struct Entity { @@ -811,7 +812,7 @@ impl framework::Example for GraphicsData { }, } }, - //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=>{