base texture transform

This commit is contained in:
Robin Appelman 2023-12-22 18:19:01 +01:00
commit 3172da6abc
3 changed files with 15 additions and 3 deletions

2
Cargo.lock generated
View file

@ -627,7 +627,7 @@ dependencies = [
[[package]]
name = "vmt-parser"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"insta",
"miette",

View file

@ -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"

View file

@ -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(),