From 085ea44af52d2780a25fee2ecd1d278c1170c9ec Mon Sep 17 00:00:00 2001 From: Alexei Dobrohotov Date: Sun, 13 Dec 2020 04:19:14 +0300 Subject: [PATCH] Add BSShaderLightingProperty abstraction --- components/nif/property.cpp | 7 +++++++ components/nif/property.hpp | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/components/nif/property.cpp b/components/nif/property.cpp index 55113d7c8..d5357e123 100644 --- a/components/nif/property.cpp +++ b/components/nif/property.cpp @@ -111,6 +111,13 @@ void BSShaderProperty::read(NIFStream *nif) } } +void BSShaderLightingProperty::read(NIFStream *nif) +{ + BSShaderProperty::read(nif); + if (nif->getBethVersion() <= NIFFile::BethVersion::BETHVER_FO3) + clamp = nif->getUInt(); +} + void NiFogProperty::read(NIFStream *nif) { Property::read(nif); diff --git a/components/nif/property.hpp b/components/nif/property.hpp index 5bc0c52db..813a1888d 100644 --- a/components/nif/property.hpp +++ b/components/nif/property.hpp @@ -125,6 +125,12 @@ struct BSShaderProperty : public NiShadeProperty void read(NIFStream *nif) override; }; +struct BSShaderLightingProperty : public BSShaderProperty +{ + unsigned int clamp{0u}; + void read(NIFStream *nif) override; +}; + struct NiDitherProperty : public Property { unsigned short flags;