mirror of
https://codeberg.org/icewind/vbspview.git
synced 2026-06-03 10:14:10 +02:00
updates
This commit is contained in:
parent
4132469228
commit
6f8ef888a9
4 changed files with 469 additions and 498 deletions
911
Cargo.lock
generated
911
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -8,10 +8,11 @@ license = "MIT"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
three-d = { version = "0.16.4", features = ["egui-gui"] }
|
three-d = { version = "0.16.4", features = ["egui-gui"] }
|
||||||
three-d-asset = { version = "0.6" }
|
three-d-asset = { version = "0.6" }
|
||||||
vbsp = "0.6.0"
|
vbsp = { version = "0.8.1" }
|
||||||
|
vbsp-entities-tf2 = "0.4.0"
|
||||||
miette = { version = "7.2.0", features = ["fancy"] }
|
miette = { version = "7.2.0", features = ["fancy"] }
|
||||||
thiserror = "1.0.63"
|
thiserror = "2.0.12"
|
||||||
itertools = "0.13.0"
|
itertools = "0.14.0"
|
||||||
vmdl = "0.2.0"
|
vmdl = "0.2.0"
|
||||||
tracing = "0.1.40"
|
tracing = "0.1.40"
|
||||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||||
|
|
@ -23,7 +24,7 @@ splines = { version = "4.3.1", features = ["cgmath"] }
|
||||||
vtf = "0.3.0"
|
vtf = "0.3.0"
|
||||||
vmt-parser = "0.2.0"
|
vmt-parser = "0.2.0"
|
||||||
image = "0.25.2"
|
image = "0.25.2"
|
||||||
tf-asset-loader = { version = "0.1.7", features = ["bsp"] }
|
tf-asset-loader = { version = "0.2.0", features = ["bsp"] }
|
||||||
rayon = "1.10.0"
|
rayon = "1.10.0"
|
||||||
|
|
||||||
[profile.dev.package."*"]
|
[profile.dev.package."*"]
|
||||||
|
|
|
||||||
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"crane": {
|
"crane": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733688869,
|
"lastModified": 1739936662,
|
||||||
"narHash": "sha256-KrhxxFj1CjESDrL5+u/zsVH0K+Ik9tvoac/oFPoxSB8=",
|
"narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=",
|
||||||
"owner": "ipetkov",
|
"owner": "ipetkov",
|
||||||
"repo": "crane",
|
"repo": "crane",
|
||||||
"rev": "604637106e420ad99907cae401e13ab6b452e7d9",
|
"rev": "19de14aaeb869287647d9461cbd389187d8ecdb7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -44,11 +44,11 @@
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735052218,
|
"lastModified": 1740783063,
|
||||||
"narHash": "sha256-I30wh6G8fSUO4EseexxiDXcxyUhXR6C8BvEeKn6xyfE=",
|
"narHash": "sha256-nJ/tvNBWFNJtwtNG/KsqtVq4p3aitkEb1pRW0qHvmsk=",
|
||||||
"owner": "icewind1991",
|
"owner": "icewind1991",
|
||||||
"repo": "mill-scale",
|
"repo": "mill-scale",
|
||||||
"rev": "7e45bb598ff63a8416ee3c26743b20644563bd93",
|
"rev": "591ea924cfd3cd7932b385341fb0aad0a935bb46",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -88,11 +88,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733884434,
|
"lastModified": 1740277845,
|
||||||
"narHash": "sha256-8GXR9kC07dyOIshAyfZhG11xfvBRSZzYghnZ2weOKJU=",
|
"narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "d0483df44ddf0fd1985f564abccbe568e020ddf2",
|
"rev": "f933070c29f9c1c5457447a51903f27f76ebb519",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
19
src/bsp.rs
19
src/bsp.rs
|
|
@ -7,7 +7,8 @@ use std::collections::{HashMap, HashSet};
|
||||||
use tf_asset_loader::Loader;
|
use tf_asset_loader::Loader;
|
||||||
use three_d::{CpuModel, Positions, Vec3};
|
use three_d::{CpuModel, Positions, Vec3};
|
||||||
use three_d_asset::{Geometry, Primitive, TriMesh};
|
use three_d_asset::{Geometry, Primitive, TriMesh};
|
||||||
use vbsp::{Bsp, Entity, Handle, Vector};
|
use vbsp::{AsPropPlacement, Bsp, Handle, Vector};
|
||||||
|
use vbsp_entities_tf2::Entity;
|
||||||
|
|
||||||
pub fn load_map(
|
pub fn load_map(
|
||||||
data: &[u8],
|
data: &[u8],
|
||||||
|
|
@ -19,10 +20,10 @@ pub fn load_map(
|
||||||
let mut models = Vec::with_capacity(bsp.static_props().count() + 1);
|
let mut models = Vec::with_capacity(bsp.static_props().count() + 1);
|
||||||
models.push(world);
|
models.push(world);
|
||||||
// println!("{:#?}", bsp.entities);
|
// println!("{:#?}", bsp.entities);
|
||||||
let entity_props =
|
let entity_props = bsp
|
||||||
bsp.entities
|
.entities
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|ent| ent.parse())
|
.flat_map(|ent| ent.parse::<Entity>())
|
||||||
.filter_map(|ent| match ent {
|
.filter_map(|ent| match ent {
|
||||||
Entity::PropDynamic(prop) => Some(prop.as_prop_placement()),
|
Entity::PropDynamic(prop) => Some(prop.as_prop_placement()),
|
||||||
Entity::PropPhysics(prop) => Some(prop.as_prop_placement()),
|
Entity::PropPhysics(prop) => Some(prop.as_prop_placement()),
|
||||||
|
|
@ -144,13 +145,13 @@ fn load_world(data: &[u8], loader: &mut Loader, textures: bool) -> Result<(CpuMo
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|ent| ent.parse())
|
.flat_map(|ent| ent.parse())
|
||||||
.filter_map(|ent| match ent {
|
.filter_map(|ent| match ent {
|
||||||
Entity::Brush(ent)
|
Entity::FuncBrush(ent) => Some((ent.model.unwrap_or_default(), ent.origin)),
|
||||||
| Entity::BrushIllusionary(ent)
|
Entity::FuncIllusionary(ent) => Some((ent.model.unwrap_or_default(), ent.origin)),
|
||||||
| Entity::BrushWall(ent)
|
Entity::FuncWall(ent) => Some((ent.model, Default::default())),
|
||||||
| Entity::BrushWallToggle(ent) => Some(ent),
|
Entity::FuncWallToggle(ent) => Some((ent.model, Default::default())),
|
||||||
_ => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
.flat_map(|brush| Some((brush.model[1..].parse::<usize>().ok()?, brush.origin)))
|
.flat_map(|(model_index, origin)| Some((model_index[1..].parse::<usize>().ok()?, origin)))
|
||||||
.flat_map(|(index, origin)| Some((bsp.models().nth(index)?, origin)))
|
.flat_map(|(index, origin)| Some((bsp.models().nth(index)?, origin)))
|
||||||
.collect();
|
.collect();
|
||||||
models.push((
|
models.push((
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue