From 717b93d61e9b2d7820c7fe3f86c2366cc6301657 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 22 Sep 2023 03:04:36 +0300 Subject: [PATCH] Read BSPSysLODModifier --- components/nif/niffile.cpp | 3 +++ components/nif/particle.cpp | 10 ++++++++++ components/nif/particle.hpp | 10 ++++++++++ components/nif/record.hpp | 1 + 4 files changed, 24 insertions(+) diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index a89540ac15..b3cc294d6e 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -296,6 +296,9 @@ namespace Nif { "NiPSysAgeDeathModifier", &construct }, { "NiPSysSpawnModifier", &construct }, + // Modifiers, Bethesda + { "BSPSysLODModifier", &construct }, + // Modifier controllers, Gamebryo { "NiPSysAirFieldAirFrictionCtlr", &construct }, { "NiPSysAirFieldInheritVelocityCtlr", diff --git a/components/nif/particle.cpp b/components/nif/particle.cpp index 04da656e9d..26a22394d8 100644 --- a/components/nif/particle.cpp +++ b/components/nif/particle.cpp @@ -267,6 +267,16 @@ namespace Nif nif->read(mLifespanVariation); } + void BSPSysLODModifier::read(NIFStream* nif) + { + NiPSysModifier::read(nif); + + nif->read(mLODStartDistance); + nif->read(mLODEndDistance); + nif->read(mEndEmitScale); + nif->read(mEndSize); + } + void NiPSysModifierCtlr::read(NIFStream* nif) { NiSingleInterpController::read(nif); diff --git a/components/nif/particle.hpp b/components/nif/particle.hpp index b556b0b285..a743834d98 100644 --- a/components/nif/particle.hpp +++ b/components/nif/particle.hpp @@ -200,6 +200,16 @@ namespace Nif void read(NIFStream* nif) override; }; + struct BSPSysLODModifier : NiPSysModifier + { + float mLODStartDistance; + float mLODEndDistance; + float mEndEmitScale; + float mEndSize; + + void read(NIFStream* nif) override; + }; + // Abstract struct NiPSysModifierCtlr : NiSingleInterpController { diff --git a/components/nif/record.hpp b/components/nif/record.hpp index 78bbb0f062..70cb67e749 100644 --- a/components/nif/record.hpp +++ b/components/nif/record.hpp @@ -94,6 +94,7 @@ namespace Nif RC_BSMultiBoundSphere, RC_BSNiAlphaPropertyTestRefController, RC_BSPackedAdditionalGeometryData, + RC_BSPSysLODModifier, RC_BSStripParticleSystem, RC_BSStripPSysData, RC_BSRefractionFirePeriodController,