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]]
|
||||
name = "vmt-parser"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"insta",
|
||||
"miette",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "vmt-parser"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
edition = "2021"
|
||||
description = "Rust parser for valve vmt files."
|
||||
license = "MIT"
|
||||
|
|
@ -18,4 +18,4 @@ serde_repr = "0.1.17"
|
|||
test-case = "3.3.1"
|
||||
insta = { version = "1.34.0", features = ["ron"] }
|
||||
miette = { version = "5.10.0", features = ["fancy"] }
|
||||
walkdir = "2.4.0"
|
||||
walkdir = "2.4.0"
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ mod vertexlitgeneric;
|
|||
mod water;
|
||||
mod worldvertextransition;
|
||||
|
||||
use crate::TextureTransform;
|
||||
pub use cable::CableMaterial;
|
||||
pub use eyerefract::EyeRefractMaterial;
|
||||
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> {
|
||||
match self {
|
||||
Material::LightMappedGeneric(mat) => mat.bump_map.as_deref(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue