mirror of
https://codeberg.org/icewind/vmt-parser.git
synced 2026-06-03 12:04:06 +02:00
LightMappedGeneric
This commit is contained in:
parent
971b42452d
commit
ab10e2d05c
14 changed files with 378 additions and 243 deletions
18
tests/parse.rs
Normal file
18
tests/parse.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use miette::{GraphicalReportHandler, GraphicalTheme};
|
||||
use std::fs::read_to_string;
|
||||
use test_case::test_case;
|
||||
use vmt_parser::from_str;
|
||||
|
||||
#[test_case("tests/data/concretefloor003.vmt")]
|
||||
fn test_serde(path: &str) {
|
||||
let raw = read_to_string(path).unwrap();
|
||||
match from_str(&raw) {
|
||||
Ok(result) => insta::assert_ron_snapshot!(path, result),
|
||||
Err(e) => {
|
||||
let handler = GraphicalReportHandler::new_themed(GraphicalTheme::unicode_nocolor());
|
||||
let mut out = String::new();
|
||||
handler.render_report(&mut out, &e).unwrap();
|
||||
insta::assert_snapshot!(path, out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
source: tests/parse.rs
|
||||
expression: result
|
||||
---
|
||||
lightmappedgeneric(LightMappedGenericMaterial(
|
||||
r#$basetexture: "cp_mountainlab/concrete/concretefloor003",
|
||||
r#$decal: false,
|
||||
r#$detail: Some("overlays/detail001"),
|
||||
r#$surfaceprop: None,
|
||||
r#$basetexturetransform: "center 0.5 0.5 scale 1 1 rotate 0 translate 0 0",
|
||||
r#$color: Vec3((1.0, 1.0, 1.0)),
|
||||
r#$decalscale: 1.0,
|
||||
r#$decalscale: Vec2((4.0, 4.0)),
|
||||
r#$detailblendfactor: 1.0,
|
||||
r#$detailblendmode: 0,
|
||||
r#$modelmaterial: None,
|
||||
r#$pointsamplemagfilter: false,
|
||||
r#$seamless_scale: 1.0,
|
||||
r#$alpha: 1.0,
|
||||
r#$alphatest: false,
|
||||
r#$distancealpha: false,
|
||||
r#$nocull: false,
|
||||
r#$translucent: false,
|
||||
r#$bumpmap: Some("concrete/concretefloor007b_height-ssbump"),
|
||||
r#$lightwarptexture: None,
|
||||
r#$selfillum: false,
|
||||
r#$ssbump: true,
|
||||
r#$envmap: None,
|
||||
r#$phong: false,
|
||||
r#$nofog: false,
|
||||
))
|
||||
Loading…
Add table
Add a link
Reference in a new issue