mirror of
https://codeberg.org/icewind/vbspview.git
synced 2026-06-03 18:24:09 +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]
|
||||
three-d = { version = "0.16.4", features = ["egui-gui"] }
|
||||
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"] }
|
||||
thiserror = "1.0.63"
|
||||
itertools = "0.13.0"
|
||||
thiserror = "2.0.12"
|
||||
itertools = "0.14.0"
|
||||
vmdl = "0.2.0"
|
||||
tracing = "0.1.40"
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||
|
|
@ -23,7 +24,7 @@ splines = { version = "4.3.1", features = ["cgmath"] }
|
|||
vtf = "0.3.0"
|
||||
vmt-parser = "0.2.0"
|
||||
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"
|
||||
|
||||
[profile.dev.package."*"]
|
||||
|
|
|
|||
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"crane": {
|
||||
"locked": {
|
||||
"lastModified": 1733688869,
|
||||
"narHash": "sha256-KrhxxFj1CjESDrL5+u/zsVH0K+Ik9tvoac/oFPoxSB8=",
|
||||
"lastModified": 1739936662,
|
||||
"narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "604637106e420ad99907cae401e13ab6b452e7d9",
|
||||
"rev": "19de14aaeb869287647d9461cbd389187d8ecdb7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -44,11 +44,11 @@
|
|||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1735052218,
|
||||
"narHash": "sha256-I30wh6G8fSUO4EseexxiDXcxyUhXR6C8BvEeKn6xyfE=",
|
||||
"lastModified": 1740783063,
|
||||
"narHash": "sha256-nJ/tvNBWFNJtwtNG/KsqtVq4p3aitkEb1pRW0qHvmsk=",
|
||||
"owner": "icewind1991",
|
||||
"repo": "mill-scale",
|
||||
"rev": "7e45bb598ff63a8416ee3c26743b20644563bd93",
|
||||
"rev": "591ea924cfd3cd7932b385341fb0aad0a935bb46",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -88,11 +88,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733884434,
|
||||
"narHash": "sha256-8GXR9kC07dyOIshAyfZhG11xfvBRSZzYghnZ2weOKJU=",
|
||||
"lastModified": 1740277845,
|
||||
"narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "d0483df44ddf0fd1985f564abccbe568e020ddf2",
|
||||
"rev": "f933070c29f9c1c5457447a51903f27f76ebb519",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
33
src/bsp.rs
33
src/bsp.rs
|
|
@ -7,7 +7,8 @@ use std::collections::{HashMap, HashSet};
|
|||
use tf_asset_loader::Loader;
|
||||
use three_d::{CpuModel, Positions, Vec3};
|
||||
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(
|
||||
data: &[u8],
|
||||
|
|
@ -19,16 +20,16 @@ pub fn load_map(
|
|||
let mut models = Vec::with_capacity(bsp.static_props().count() + 1);
|
||||
models.push(world);
|
||||
// println!("{:#?}", bsp.entities);
|
||||
let entity_props =
|
||||
bsp.entities
|
||||
.iter()
|
||||
.flat_map(|ent| ent.parse())
|
||||
.filter_map(|ent| match ent {
|
||||
Entity::PropDynamic(prop) => Some(prop.as_prop_placement()),
|
||||
Entity::PropPhysics(prop) => Some(prop.as_prop_placement()),
|
||||
Entity::PropDynamicOverride(prop) => Some(prop.as_prop_placement()),
|
||||
_ => None,
|
||||
});
|
||||
let entity_props = bsp
|
||||
.entities
|
||||
.iter()
|
||||
.flat_map(|ent| ent.parse::<Entity>())
|
||||
.filter_map(|ent| match ent {
|
||||
Entity::PropDynamic(prop) => Some(prop.as_prop_placement()),
|
||||
Entity::PropPhysics(prop) => Some(prop.as_prop_placement()),
|
||||
Entity::PropDynamicOverride(prop) => Some(prop.as_prop_placement()),
|
||||
_ => None,
|
||||
});
|
||||
let static_props = bsp.static_props().map(|prop| prop.as_prop_placement());
|
||||
|
||||
if props {
|
||||
|
|
@ -144,13 +145,13 @@ fn load_world(data: &[u8], loader: &mut Loader, textures: bool) -> Result<(CpuMo
|
|||
.iter()
|
||||
.flat_map(|ent| ent.parse())
|
||||
.filter_map(|ent| match ent {
|
||||
Entity::Brush(ent)
|
||||
| Entity::BrushIllusionary(ent)
|
||||
| Entity::BrushWall(ent)
|
||||
| Entity::BrushWallToggle(ent) => Some(ent),
|
||||
Entity::FuncBrush(ent) => Some((ent.model.unwrap_or_default(), ent.origin)),
|
||||
Entity::FuncIllusionary(ent) => Some((ent.model.unwrap_or_default(), ent.origin)),
|
||||
Entity::FuncWall(ent) => Some((ent.model, Default::default())),
|
||||
Entity::FuncWallToggle(ent) => Some((ent.model, Default::default())),
|
||||
_ => 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)))
|
||||
.collect();
|
||||
models.push((
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue