diff --git a/components/nif/controller.cpp b/components/nif/controller.cpp index 5dcf6ef80d..a3033357ec 100644 --- a/components/nif/controller.cpp +++ b/components/nif/controller.cpp @@ -583,6 +583,23 @@ namespace Nif nif->read(mFloatsExtraDataIndex); } + void NiPathInterpolator::read(NIFStream* nif) + { + nif->read(mFlags); + nif->read(mBankDirection); + nif->read(mMaxBankAngle); + nif->read(mSmoothing); + nif->read(mFollowAxis); + mPathData.read(nif); + mPercentData.read(nif); + } + + void NiPathInterpolator::post(Reader& nif) + { + mPathData.post(nif); + mPercentData.post(nif); + } + void NiBlendInterpolator::read(NIFStream* nif) { if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 112)) diff --git a/components/nif/controller.hpp b/components/nif/controller.hpp index 31f3d19f91..8a7d306a85 100644 --- a/components/nif/controller.hpp +++ b/components/nif/controller.hpp @@ -404,6 +404,21 @@ namespace Nif using NiTransformInterpolator = TypedNiInterpolator; using NiColorInterpolator = TypedNiInterpolator; + struct NiPathInterpolator : public NiInterpolator + { + // Uses the same flags as NiPathController + uint16_t mFlags; + int32_t mBankDirection; + float mMaxBankAngle; + float mSmoothing; + uint16_t mFollowAxis; + NiPosDataPtr mPathData; + NiFloatDataPtr mPercentData; + + void read(NIFStream* nif) override; + void post(Reader& nif) override; + }; + // Abstract struct NiBlendInterpolator : public NiInterpolator { diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index 0e4ef39b60..bad2482432 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -108,6 +108,8 @@ namespace Nif { "NiGeomMorpherController", &construct }, { "NiKeyframeController", &construct }, { "NiLookAtController", &construct }, + // FIXME: NiLightColorController should have its own struct + { "NiLightColorController", &construct }, { "NiMaterialColorController", &construct }, { "NiPathController", &construct }, { "NiRollController", &construct }, @@ -162,6 +164,7 @@ namespace Nif { "NiBoolTimelineInterpolator", &construct }, { "NiColorInterpolator", &construct }, { "NiFloatInterpolator", &construct }, + { "NiPathInterpolator", &construct }, { "NiPoint3Interpolator", &construct }, { "NiTransformInterpolator", &construct }, diff --git a/components/nif/record.hpp b/components/nif/record.hpp index 0b7c239442..b26233259a 100644 --- a/components/nif/record.hpp +++ b/components/nif/record.hpp @@ -151,6 +151,7 @@ namespace Nif RC_NiKeyframeController, RC_NiKeyframeData, RC_NiLight, + RC_NiLightColorController, RC_NiLightDimmerController, RC_NiLines, RC_NiLinesData, @@ -169,6 +170,7 @@ namespace Nif RC_NiParticlesData, RC_NiParticleSystemController, RC_NiPathController, + RC_NiPathInterpolator, RC_NiPixelData, RC_NiPlanarCollider, RC_NiPoint3Interpolator,