From 1cdaa5d53a3e9f6f84f59de78fc141ede264668f Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 2 Oct 2023 22:29:57 -0700 Subject: [PATCH] fake IBSP --- src/main.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7f99163..5bc9d39 100644 --- a/src/main.rs +++ b/src/main.rs @@ -812,7 +812,21 @@ impl framework::Example for GraphicsData { }, } }, - b"VBSP"=>Some(load_bsp::generate_indexed_models(input)), + b"VBSP"=>{ + let mut entire_file=Vec::new(); + match std::io::Read::read_to_end(&mut input, &mut entire_file){ + Ok(_)=>{ + //haha yes this is a quake file what do you mean + entire_file[0]=b'I'; + entire_file[4..8].copy_from_slice(&0x2ei32.to_le_bytes()); + Some(load_bsp::generate_indexed_models(&mut std::io::Cursor::new(entire_file))) + }, + Err(e)=>{ + println!("Error loading \"valve\" file:{:?}",e); + None + }, + } + }, //b"SNFM"=>Some(sniffer::generate_indexed_models(input)), //b"SNFB"=>Some(sniffer::load_bot(input)), other=>{