mirror of
https://codeberg.org/icewind/vmt-parser.git
synced 2026-06-03 12:04:06 +02:00
base texture transform
This commit is contained in:
parent
f39661ca95
commit
3172da6abc
3 changed files with 15 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -627,7 +627,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vmt-parser"
|
name = "vmt-parser"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"insta",
|
"insta",
|
||||||
"miette",
|
"miette",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "vmt-parser"
|
name = "vmt-parser"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Rust parser for valve vmt files."
|
description = "Rust parser for valve vmt files."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
@ -18,4 +18,4 @@ serde_repr = "0.1.17"
|
||||||
test-case = "3.3.1"
|
test-case = "3.3.1"
|
||||||
insta = { version = "1.34.0", features = ["ron"] }
|
insta = { version = "1.34.0", features = ["ron"] }
|
||||||
miette = { version = "5.10.0", features = ["fancy"] }
|
miette = { version = "5.10.0", features = ["fancy"] }
|
||||||
walkdir = "2.4.0"
|
walkdir = "2.4.0"
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ mod vertexlitgeneric;
|
||||||
mod water;
|
mod water;
|
||||||
mod worldvertextransition;
|
mod worldvertextransition;
|
||||||
|
|
||||||
|
use crate::TextureTransform;
|
||||||
pub use cable::CableMaterial;
|
pub use cable::CableMaterial;
|
||||||
pub use eyerefract::EyeRefractMaterial;
|
pub use eyerefract::EyeRefractMaterial;
|
||||||
pub use lightmappedgeneric::LightMappedGenericMaterial;
|
pub use lightmappedgeneric::LightMappedGenericMaterial;
|
||||||
|
|
@ -132,6 +133,17 @@ impl Material {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn base_texture_transform(&self) -> Option<&TextureTransform> {
|
||||||
|
match self {
|
||||||
|
Material::LightMappedGeneric(mat) => Some(&mat.base_texture_transform),
|
||||||
|
Material::VertexLitGeneric(mat) => Some(&mat.base_texture_transform),
|
||||||
|
Material::VertexLitGenericDx6(mat) => Some(&mat.base_texture_transform),
|
||||||
|
Material::UnlitTwoTexture(mat) => Some(&mat.base_texture_transform),
|
||||||
|
Material::WorldVertexTransition(mat) => Some(&mat.base_texture_transform),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn bump_map(&self) -> Option<&str> {
|
pub fn bump_map(&self) -> Option<&str> {
|
||||||
match self {
|
match self {
|
||||||
Material::LightMappedGeneric(mat) => mat.bump_map.as_deref(),
|
Material::LightMappedGeneric(mat) => mat.bump_map.as_deref(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue