mirror of
https://codeberg.org/icewind/vmdl.git
synced 2026-06-03 16:44:11 +02:00
example fixes
This commit is contained in:
parent
12326d98d2
commit
8431ff6613
3 changed files with 10 additions and 9 deletions
9
Cargo.lock
generated
9
Cargo.lock
generated
|
|
@ -1054,16 +1054,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gltf"
|
name = "gltf"
|
||||||
version = "1.4.0"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3b78f069cf941075835822953c345b9e1edd67ae347b81ace3aea9de38c2ef33"
|
checksum = "ad2dcfb6dd7a66f9eb3d181a29dcfb22d146b0bcdc2e1ed1713cbf03939a88ea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"gltf-json",
|
"gltf-json",
|
||||||
"image 0.24.7",
|
"image 0.24.7",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"serde_json",
|
|
||||||
"urlencoding",
|
"urlencoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -1081,9 +1080,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gltf-json"
|
name = "gltf-json"
|
||||||
version = "1.4.0"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "655951ba557f2bc69ea4b0799446bae281fa78efae6319968bdd2c3e9a06d8e1"
|
checksum = "7d5b810806b78dde4b71a95cc0e6fdcab34c4c617da3574df166f9987be97d03"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gltf-derive",
|
"gltf-derive",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ iai = "0.1"
|
||||||
vtf = "0.1.6"
|
vtf = "0.1.6"
|
||||||
tracing = "0.1.40"
|
tracing = "0.1.40"
|
||||||
tracing-subscriber = "0.3.18"
|
tracing-subscriber = "0.3.18"
|
||||||
gltf-json = "1.3.0"
|
gltf-json = "=1.3.0"
|
||||||
gltf = "1.3.0"
|
gltf = "=1.3.0"
|
||||||
image = "0.23.14"
|
image = "0.23.14"
|
||||||
clap = { version = "4.4.11", features = ["derive"] }
|
clap = { version = "4.4.11", features = ["derive"] }
|
||||||
main_error = "0.1.2"
|
main_error = "0.1.2"
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ pub fn load_material(
|
||||||
let path = format!("{}.vmt", name.to_ascii_lowercase().trim_end_matches(".vmt"));
|
let path = format!("{}.vmt", name.to_ascii_lowercase().trim_end_matches(".vmt"));
|
||||||
let path = loader
|
let path = loader
|
||||||
.find_in_paths(&path, &dirs)
|
.find_in_paths(&path, &dirs)
|
||||||
.ok_or(Error::Other(format!("Can't find file {}", path)))?;
|
.ok_or_else(|| Error::Other(format!("Can't find file {}", path)))?;
|
||||||
let raw = loader.load(&path)?.expect("didn't find foudn path?");
|
let raw = loader.load(&path)?.expect("didn't find foudn path?");
|
||||||
let vdf = String::from_utf8(raw)?;
|
let vdf = String::from_utf8(raw)?;
|
||||||
|
|
||||||
|
|
@ -71,7 +71,9 @@ pub fn load_material(
|
||||||
Ok::<_, Error>(vdf)
|
Ok::<_, Error>(vdf)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let base_texture = material.base_texture();
|
let base_texture = material
|
||||||
|
.base_texture()
|
||||||
|
.ok_or_else(|| Error::Other("no basetexture".into()))?;
|
||||||
|
|
||||||
let translucent = material.translucent();
|
let translucent = material.translucent();
|
||||||
let glass = material.surface_prop() == Some("glass");
|
let glass = material.surface_prop() == Some("glass");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue