diff --git a/components/nif/controller.cpp b/components/nif/controller.cpp index 32291b8c12..8dfdebb923 100644 --- a/components/nif/controller.cpp +++ b/components/nif/controller.cpp @@ -637,4 +637,10 @@ namespace Nif mScaleValue = 1.f; } } + + void BSEffectShaderPropertyFloatController::read(NIFStream* nif) + { + NiFloatInterpController::read(nif); + nif->read(mControlledVariable); + } } diff --git a/components/nif/controller.hpp b/components/nif/controller.hpp index 3f9c054906..40f0d9a949 100644 --- a/components/nif/controller.hpp +++ b/components/nif/controller.hpp @@ -406,5 +406,11 @@ namespace Nif void read(NIFStream* nif) override; }; + struct BSEffectShaderPropertyFloatController : public NiFloatInterpController + { + unsigned int mControlledVariable; + + void read(NIFStream* nif) override; + }; } // Namespace #endif diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index ef87d75db9..3034df7aab 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -5,7 +5,6 @@ #include #include -#include #include #include #include @@ -17,6 +16,7 @@ #include "effect.hpp" #include "exception.hpp" #include "extra.hpp" +#include "node.hpp" #include "physics.hpp" #include "property.hpp" @@ -198,6 +198,8 @@ namespace Nif { "BSMultiBoundSphere", &construct }, { "BSInvMarker", &construct }, { "BSTriShape", &construct }, + { "BSEffectShaderPropertyFloatController", + &construct }, }; } diff --git a/components/nif/physics.cpp b/components/nif/physics.cpp index 58e07fcf71..9636ec22da 100644 --- a/components/nif/physics.cpp +++ b/components/nif/physics.cpp @@ -327,8 +327,8 @@ namespace Nif mHavokMaterial.read(nif); mRadius = nif->getFloat(); nif->skip(8); // Unused - std::vector mat; - nif->getFloats(mat, 16); + std::array mat; + nif->readArray(mat); mTransform.set(mat.data()); } @@ -444,8 +444,8 @@ namespace Nif { bhkWorldObject::read(nif); nif->skip(8); // Unused - std::vector mat; - nif->readVector(mat, 16); + std::array mat; + nif->readArray(mat); mTransform.set(mat.data()); } } // Namespace diff --git a/components/nif/record.hpp b/components/nif/record.hpp index 1185008ce2..4a57070924 100644 --- a/components/nif/record.hpp +++ b/components/nif/record.hpp @@ -165,6 +165,7 @@ namespace Nif RC_BSMultiBoundSphere, RC_BSInvMarker, RC_BSTriShape, + RC_BSEffectShaderPropertyFloatController, }; /// Base class for all records