forked from StrafesNET/strafe-client
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
1cdaa5d53a | |||
55a1ef0d14 | |||
03a97bfa3e |
65
Cargo.lock
generated
65
Cargo.lock
generated
@ -92,6 +92,15 @@ version = "0.3.7"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
|
checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrayvec"
|
||||||
|
version = "0.4.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9"
|
||||||
|
dependencies = [
|
||||||
|
"nodrop",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayvec"
|
name = "arrayvec"
|
||||||
version = "0.7.4"
|
version = "0.7.4"
|
||||||
@ -197,7 +206,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5"
|
checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayref",
|
"arrayref",
|
||||||
"arrayvec",
|
"arrayvec 0.7.4",
|
||||||
"cc",
|
"cc",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"constant_time_eq",
|
"constant_time_eq",
|
||||||
@ -238,12 +247,33 @@ dependencies = [
|
|||||||
"objc2-encode",
|
"objc2-encode",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bsp"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b9d6d699bcff31f0c8a5951d29b9a7edfe3270218c20f6c3509f90ae7e1c46e7"
|
||||||
|
dependencies = [
|
||||||
|
"arrayvec 0.4.12",
|
||||||
|
"bitflags 1.3.2",
|
||||||
|
"bv",
|
||||||
|
"byteorder 0.5.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
version = "3.13.0"
|
version = "3.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
|
checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bv"
|
||||||
|
version = "0.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340"
|
||||||
|
dependencies = [
|
||||||
|
"feature-probe",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytemuck"
|
name = "bytemuck"
|
||||||
version = "1.13.1"
|
version = "1.13.1"
|
||||||
@ -264,6 +294,12 @@ dependencies = [
|
|||||||
"syn 2.0.29",
|
"syn 2.0.29",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "byteorder"
|
||||||
|
version = "0.5.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byteorder"
|
name = "byteorder"
|
||||||
version = "1.4.3"
|
version = "1.4.3"
|
||||||
@ -423,7 +459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "594ecd967c2f40db5dde8da4c356975fc1fe030e951c7c3962f6dc2e80042e87"
|
checksum = "594ecd967c2f40db5dde8da4c356975fc1fe030e951c7c3962f6dc2e80042e87"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"byteorder",
|
"byteorder 1.4.3",
|
||||||
"enum_primitive",
|
"enum_primitive",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -532,6 +568,12 @@ dependencies = [
|
|||||||
"simd-adler32",
|
"simd-adler32",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "feature-probe"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
version = "1.0.27"
|
version = "1.0.27"
|
||||||
@ -1058,6 +1100,12 @@ dependencies = [
|
|||||||
"memoffset",
|
"memoffset",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nodrop"
|
||||||
|
version = "0.1.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "7.1.3"
|
version = "7.1.3"
|
||||||
@ -1506,7 +1554,7 @@ version = "0.8.12"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20"
|
checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder 1.4.3",
|
||||||
"num-traits 0.2.16",
|
"num-traits 0.2.16",
|
||||||
"paste",
|
"paste",
|
||||||
]
|
]
|
||||||
@ -1517,7 +1565,7 @@ version = "1.1.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a"
|
checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder 1.4.3",
|
||||||
"rmp",
|
"rmp",
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
@ -1662,6 +1710,7 @@ name = "strafe-client"
|
|||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-executor",
|
"async-executor",
|
||||||
|
"bsp",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"ddsfile",
|
"ddsfile",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
@ -1748,7 +1797,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67"
|
checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayref",
|
"arrayref",
|
||||||
"arrayvec",
|
"arrayvec 0.7.4",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"png",
|
"png",
|
||||||
@ -1992,7 +2041,7 @@ version = "0.17.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7472f3b69449a8ae073f6ec41d05b6f846902d92a6c45313c50cb25857b736ce"
|
checksum = "7472f3b69449a8ae073f6ec41d05b6f846902d92a6c45313c50cb25857b736ce"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec 0.7.4",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"log",
|
"log",
|
||||||
@ -2016,7 +2065,7 @@ version = "0.17.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ecf7454d9386f602f7399225c92dd2fbdcde52c519bc8fb0bd6fbeb388075dc2"
|
checksum = "ecf7454d9386f602f7399225c92dd2fbdcde52c519bc8fb0bd6fbeb388075dc2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec 0.7.4",
|
||||||
"bit-vec",
|
"bit-vec",
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
"codespan-reporting",
|
"codespan-reporting",
|
||||||
@ -2040,7 +2089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "6654a13885a17f475e8324efb46dc6986d7aaaa98353330f8de2077b153d0101"
|
checksum = "6654a13885a17f475e8324efb46dc6986d7aaaa98353330f8de2077b153d0101"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_system_properties",
|
"android_system_properties",
|
||||||
"arrayvec",
|
"arrayvec 0.7.4",
|
||||||
"ash",
|
"ash",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
|
@ -7,6 +7,7 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-executor = "1.5.1"
|
async-executor = "1.5.1"
|
||||||
|
bsp = "0.1.2"
|
||||||
bytemuck = { version = "1.13.1", features = ["derive"] }
|
bytemuck = { version = "1.13.1", features = ["derive"] }
|
||||||
ddsfile = "0.5.1"
|
ddsfile = "0.5.1"
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
|
16
src/load_bsp.rs
Normal file
16
src/load_bsp.rs
Normal 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,
|
||||||
|
}
|
||||||
|
}
|
17
src/main.rs
17
src/main.rs
@ -10,6 +10,7 @@ mod zeroes;
|
|||||||
mod framework;
|
mod framework;
|
||||||
mod primitives;
|
mod primitives;
|
||||||
mod instruction;
|
mod instruction;
|
||||||
|
mod load_bsp;
|
||||||
mod load_roblox;
|
mod load_roblox;
|
||||||
|
|
||||||
struct Entity {
|
struct Entity {
|
||||||
@ -811,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"SNFM"=>Some(sniffer::generate_indexed_models(input)),
|
||||||
//b"SNFB"=>Some(sniffer::load_bot(input)),
|
//b"SNFB"=>Some(sniffer::load_bot(input)),
|
||||||
other=>{
|
other=>{
|
||||||
|
Loading…
Reference in New Issue
Block a user