Rename Controller->NiTimeController, update NiTimeController and related code

macos_ci_fix
Alexei Kotov 1 year ago
parent 04d3f6a42d
commit 0fe095303f

@ -20,7 +20,7 @@ namespace Nif::Testing
{ {
value.mExtra = ExtraPtr(nullptr); value.mExtra = ExtraPtr(nullptr);
value.mExtraList = ExtraList(); value.mExtraList = ExtraList();
value.mController = ControllerPtr(nullptr); value.mController = NiTimeControllerPtr(nullptr);
} }
inline void init(NiAVObject& value) inline void init(NiAVObject& value)
@ -55,14 +55,14 @@ namespace Nif::Testing
value.mRoot = NiAVObjectPtr(nullptr); value.mRoot = NiAVObjectPtr(nullptr);
} }
inline void init(Controller& value) inline void init(NiTimeController& value)
{ {
value.next = ControllerPtr(nullptr); value.mNext = NiTimeControllerPtr(nullptr);
value.flags = 0; value.mFlags = 0;
value.frequency = 0; value.mFrequency = 0;
value.phase = 0; value.mPhase = 0;
value.timeStart = 0; value.mTimeStart = 0;
value.timeStop = 0; value.mTimeStop = 0;
value.mTarget = NiObjectNETPtr(nullptr); value.mTarget = NiObjectNETPtr(nullptr);
} }
} }

@ -300,7 +300,7 @@ namespace
Nif::NiStringExtraData mNiStringExtraData; Nif::NiStringExtraData mNiStringExtraData;
Nif::NiStringExtraData mNiStringExtraData2; Nif::NiStringExtraData mNiStringExtraData2;
Nif::NiIntegerExtraData mNiIntegerExtraData; Nif::NiIntegerExtraData mNiIntegerExtraData;
Nif::Controller mController; Nif::NiTimeController mController;
btTransform mTransform{ btMatrix3x3(btQuaternion(btVector3(1, 0, 0), 0.5f)), btVector3(1, 2, 3) }; btTransform mTransform{ btMatrix3x3(btQuaternion(btVector3(1, 0, 0), 0.5f)), btVector3(1, 2, 3) };
btTransform mTransformScale2{ btMatrix3x3(btQuaternion(btVector3(1, 0, 0), 0.5f)), btVector3(2, 4, 6) }; btTransform mTransformScale2{ btMatrix3x3(btQuaternion(btVector3(1, 0, 0), 0.5f)), btVector3(2, 4, 6) };
btTransform mTransformScale3{ btMatrix3x3(btQuaternion(btVector3(1, 0, 0), 0.5f)), btVector3(3, 6, 9) }; btTransform mTransformScale3{ btMatrix3x3(btQuaternion(btVector3(1, 0, 0), 0.5f)), btVector3(3, 6, 9) };
@ -817,11 +817,11 @@ namespace
TEST_F(TestBulletNifLoader, for_tri_shape_child_node_with_controller_should_return_animated_shape) TEST_F(TestBulletNifLoader, for_tri_shape_child_node_with_controller_should_return_animated_shape)
{ {
mController.recType = Nif::RC_NiKeyframeController; mController.recType = Nif::RC_NiKeyframeController;
mController.flags |= Nif::Controller::Flag_Active; mController.mFlags |= Nif::NiTimeController::Flag_Active;
copy(mTransform, mNiTriShape.mTransform); copy(mTransform, mNiTriShape.mTransform);
mNiTriShape.mTransform.mScale = 3; mNiTriShape.mTransform.mScale = 3;
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
mNiTriShape.mController = Nif::ControllerPtr(&mController); mNiTriShape.mController = Nif::NiTimeControllerPtr(&mController);
mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) }; mNiNode.mChildren = Nif::NiAVObjectList{ Nif::NiAVObjectPtr(&mNiTriShape) };
mNiNode.mTransform.mScale = 4; mNiNode.mTransform.mScale = 4;
@ -847,14 +847,14 @@ namespace
TEST_F(TestBulletNifLoader, for_two_tri_shape_children_nodes_where_one_with_controller_should_return_animated_shape) TEST_F(TestBulletNifLoader, for_two_tri_shape_children_nodes_where_one_with_controller_should_return_animated_shape)
{ {
mController.recType = Nif::RC_NiKeyframeController; mController.recType = Nif::RC_NiKeyframeController;
mController.flags |= Nif::Controller::Flag_Active; mController.mFlags |= Nif::NiTimeController::Flag_Active;
copy(mTransform, mNiTriShape.mTransform); copy(mTransform, mNiTriShape.mTransform);
mNiTriShape.mTransform.mScale = 3; mNiTriShape.mTransform.mScale = 3;
mNiTriShape.mParents.push_back(&mNiNode); mNiTriShape.mParents.push_back(&mNiNode);
copy(mTransform, mNiTriShape2.mTransform); copy(mTransform, mNiTriShape2.mTransform);
mNiTriShape2.mTransform.mScale = 3; mNiTriShape2.mTransform.mScale = 3;
mNiTriShape2.mParents.push_back(&mNiNode); mNiTriShape2.mParents.push_back(&mNiNode);
mNiTriShape2.mController = Nif::ControllerPtr(&mController); mNiTriShape2.mController = Nif::NiTimeControllerPtr(&mController);
mNiNode.mChildren = Nif::NiAVObjectList{ mNiNode.mChildren = Nif::NiAVObjectList{
Nif::NiAVObjectPtr(&mNiTriShape), Nif::NiAVObjectPtr(&mNiTriShape),
Nif::NiAVObjectPtr(&mNiTriShape2), Nif::NiAVObjectPtr(&mNiTriShape2),

@ -21,7 +21,7 @@ namespace Nif
void post(Reader& nif) override { mNext.post(nif); } void post(Reader& nif) override { mNext.post(nif); }
}; };
struct Controller : public Record struct NiTimeController : public Record
{ {
enum Flags enum Flags
{ {
@ -36,17 +36,17 @@ namespace Nif
Mask = 6 Mask = 6
}; };
ControllerPtr next; NiTimeControllerPtr mNext;
int flags; uint16_t mFlags;
float frequency, phase; float mFrequency, mPhase;
float timeStart, timeStop; float mTimeStart, mTimeStop;
NiObjectNETPtr mTarget; NiObjectNETPtr mTarget;
void read(NIFStream* nif) override; void read(NIFStream* nif) override;
void post(Reader& nif) override; void post(Reader& nif) override;
bool isActive() const { return flags & Flag_Active; } bool isActive() const { return mFlags & Flag_Active; }
ExtrapolationMode extrapolationMode() const { return static_cast<ExtrapolationMode>(flags & Mask); } ExtrapolationMode extrapolationMode() const { return static_cast<ExtrapolationMode>(mFlags & Mask); }
}; };
/// Abstract object that has a name, extra data and controllers /// Abstract object that has a name, extra data and controllers
@ -55,7 +55,7 @@ namespace Nif
std::string mName; std::string mName;
ExtraPtr mExtra; ExtraPtr mExtra;
ExtraList mExtraList; ExtraList mExtraList;
ControllerPtr mController; NiTimeControllerPtr mController;
void read(NIFStream* nif) override; void read(NIFStream* nif) override;
void post(Reader& nif) override; void post(Reader& nif) override;

@ -9,21 +9,21 @@
namespace Nif namespace Nif
{ {
void Controller::read(NIFStream* nif) void NiTimeController::read(NIFStream* nif)
{ {
next.read(nif); mNext.read(nif);
nif->read(mFlags);
flags = nif->getUShort(); nif->read(mFrequency);
frequency = nif->getFloat(); nif->read(mPhase);
phase = nif->getFloat(); nif->read(mTimeStart);
timeStart = nif->getFloat(); nif->read(mTimeStop);
timeStop = nif->getFloat(); if (nif->getVersion() >= NIFStream::generateVersion(3, 3, 0, 13))
mTarget.read(nif); mTarget.read(nif);
} }
void Controller::post(Reader& nif) void NiTimeController::post(Reader& nif)
{ {
next.post(nif); mNext.post(nif);
mTarget.post(nif); mTarget.post(nif);
} }
@ -109,7 +109,7 @@ namespace Nif
nif->read(mWeight); nif->read(mWeight);
mTextKeys.read(nif); mTextKeys.read(nif);
mExtrapolationMode = static_cast<Controller::ExtrapolationMode>(nif->getUInt()); mExtrapolationMode = static_cast<NiTimeController::ExtrapolationMode>(nif->getUInt());
mFrequency = nif->getFloat(); mFrequency = nif->getFloat();
if (nif->getVersion() <= NIFStream::generateVersion(10, 4, 0, 1)) if (nif->getVersion() <= NIFStream::generateVersion(10, 4, 0, 1))
nif->read(mPhase); nif->read(mPhase);
@ -142,7 +142,7 @@ namespace Nif
void NiInterpController::read(NIFStream* nif) void NiInterpController::read(NIFStream* nif)
{ {
Controller::read(nif); NiTimeController::read(nif);
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 104) if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 104)
&& nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 108)) && nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 108))
@ -166,7 +166,7 @@ namespace Nif
void NiParticleSystemController::read(NIFStream* nif) void NiParticleSystemController::read(NIFStream* nif)
{ {
Controller::read(nif); NiTimeController::read(nif);
velocity = nif->getFloat(); velocity = nif->getFloat();
velocityRandom = nif->getFloat(); velocityRandom = nif->getFloat();
@ -220,7 +220,7 @@ namespace Nif
void NiParticleSystemController::post(Reader& nif) void NiParticleSystemController::post(Reader& nif)
{ {
Controller::post(nif); NiTimeController::post(nif);
emitter.post(nif); emitter.post(nif);
affectors.post(nif); affectors.post(nif);
@ -234,7 +234,7 @@ namespace Nif
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0)) if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0))
mTargetColor = static_cast<TargetColor>(nif->get<uint16_t>() & 3); mTargetColor = static_cast<TargetColor>(nif->get<uint16_t>() & 3);
else else
mTargetColor = static_cast<TargetColor>((flags >> 4) & 3); mTargetColor = static_cast<TargetColor>((mFlags >> 4) & 3);
if (nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 103)) if (nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 103))
mData.read(nif); mData.read(nif);
@ -249,7 +249,7 @@ namespace Nif
void NiLookAtController::read(NIFStream* nif) void NiLookAtController::read(NIFStream* nif)
{ {
Controller::read(nif); NiTimeController::read(nif);
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0)) if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0))
nif->read(mLookAtFlags); nif->read(mLookAtFlags);
@ -258,19 +258,19 @@ namespace Nif
void NiLookAtController::post(Reader& nif) void NiLookAtController::post(Reader& nif)
{ {
Controller::post(nif); NiTimeController::post(nif);
mLookAt.post(nif); mLookAt.post(nif);
} }
void NiPathController::read(NIFStream* nif) void NiPathController::read(NIFStream* nif)
{ {
Controller::read(nif); NiTimeController::read(nif);
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0)) if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0))
nif->read(mPathFlags); nif->read(mPathFlags);
else else
mPathFlags = (flags >> 16); mPathFlags = (mFlags >> 16);
nif->read(mBankDirection); nif->read(mBankDirection);
nif->read(mMaxBankAngle); nif->read(mMaxBankAngle);
@ -282,7 +282,7 @@ namespace Nif
void NiPathController::post(Reader& nif) void NiPathController::post(Reader& nif)
{ {
Controller::post(nif); NiTimeController::post(nif);
mPathData.post(nif); mPathData.post(nif);
mPercentData.post(nif); mPercentData.post(nif);
@ -290,7 +290,7 @@ namespace Nif
void NiUVController::read(NIFStream* nif) void NiUVController::read(NIFStream* nif)
{ {
Controller::read(nif); NiTimeController::read(nif);
nif->read(mUvSet); nif->read(mUvSet);
mData.read(nif); mData.read(nif);
@ -298,7 +298,7 @@ namespace Nif
void NiUVController::post(Reader& nif) void NiUVController::post(Reader& nif)
{ {
Controller::post(nif); NiTimeController::post(nif);
mData.post(nif); mData.post(nif);
} }
@ -427,7 +427,7 @@ namespace Nif
mTexSlot = static_cast<NiTexturingProperty::TextureType>(nif->get<uint32_t>()); mTexSlot = static_cast<NiTexturingProperty::TextureType>(nif->get<uint32_t>());
if (nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 103)) if (nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 103))
{ {
nif->read(timeStart); nif->read(mTimeStart);
nif->read(mDelta); nif->read(mDelta);
} }
readRecordList(nif, mSources); readRecordList(nif, mSources);
@ -460,7 +460,7 @@ namespace Nif
void bhkBlendController::read(NIFStream* nif) void bhkBlendController::read(NIFStream* nif)
{ {
Controller::read(nif); NiTimeController::read(nif);
uint32_t numKeys; uint32_t numKeys;
nif->read(numKeys); nif->read(numKeys);
@ -486,7 +486,7 @@ namespace Nif
void NiControllerManager::read(NIFStream* nif) void NiControllerManager::read(NIFStream* nif)
{ {
Controller::read(nif); NiTimeController::read(nif);
nif->read(mCumulative); nif->read(mCumulative);
readRecordList(nif, mSequences); readRecordList(nif, mSequences);
@ -495,7 +495,7 @@ namespace Nif
void NiControllerManager::post(Reader& nif) void NiControllerManager::post(Reader& nif)
{ {
Controller::post(nif); NiTimeController::post(nif);
postRecordList(nif, mSequences); postRecordList(nif, mSequences);
mObjectPalette.post(nif); mObjectPalette.post(nif);

@ -12,7 +12,7 @@ namespace Nif
{ {
std::string mTargetName; std::string mTargetName;
NiInterpolatorPtr mInterpolator; NiInterpolatorPtr mInterpolator;
ControllerPtr mController; NiTimeControllerPtr mController;
NiBlendInterpolatorPtr mBlendInterpolator; NiBlendInterpolatorPtr mBlendInterpolator;
uint16_t mBlendIndex; uint16_t mBlendIndex;
uint8_t mPriority; uint8_t mPriority;
@ -49,7 +49,7 @@ namespace Nif
struct NiControllerSequence : public NiSequence struct NiControllerSequence : public NiSequence
{ {
float mWeight{ 1.f }; float mWeight{ 1.f };
Controller::ExtrapolationMode mExtrapolationMode{ Controller::ExtrapolationMode::Constant }; NiTimeController::ExtrapolationMode mExtrapolationMode{ NiTimeController::ExtrapolationMode::Constant };
float mFrequency{ 1.f }; float mFrequency{ 1.f };
float mPhase{ 1.f }; float mPhase{ 1.f };
float mStartTime, mStopTime; float mStartTime, mStopTime;
@ -62,7 +62,7 @@ namespace Nif
}; };
// Base class for controllers that use NiInterpolators to animate objects. // Base class for controllers that use NiInterpolators to animate objects.
struct NiInterpController : public Controller struct NiInterpController : public NiTimeController
{ {
// Usually one of the flags. // Usually one of the flags.
bool mManagerControlled{ false }; bool mManagerControlled{ false };
@ -94,7 +94,7 @@ namespace Nif
{ {
}; };
struct NiParticleSystemController : public Controller struct NiParticleSystemController : public NiTimeController
{ {
enum BSPArrayController enum BSPArrayController
{ {
@ -151,7 +151,7 @@ namespace Nif
void post(Reader& nif) override; void post(Reader& nif) override;
bool noAutoAdjust() const { return emitFlags & EmitFlag_NoAutoAdjust; } bool noAutoAdjust() const { return emitFlags & EmitFlag_NoAutoAdjust; }
bool emitAtVertex() const { return flags & BSPArrayController_AtVertex; } bool emitAtVertex() const { return mFlags & BSPArrayController_AtVertex; }
}; };
using NiBSPArrayController = NiParticleSystemController; using NiBSPArrayController = NiParticleSystemController;
@ -172,7 +172,7 @@ namespace Nif
void post(Reader& nif) override; void post(Reader& nif) override;
}; };
struct NiPathController : public Controller struct NiPathController : public NiTimeController
{ {
enum Flags enum Flags
{ {
@ -197,7 +197,7 @@ namespace Nif
void post(Reader& nif) override; void post(Reader& nif) override;
}; };
struct NiLookAtController : public Controller struct NiLookAtController : public NiTimeController
{ {
enum Flags enum Flags
{ {
@ -213,7 +213,7 @@ namespace Nif
void post(Reader& nif) override; void post(Reader& nif) override;
}; };
struct NiUVController : public Controller struct NiUVController : public NiTimeController
{ {
NiUVDataPtr mData; NiUVDataPtr mData;
uint16_t mUvSet; uint16_t mUvSet;
@ -295,7 +295,7 @@ namespace Nif
void post(Reader& nif) override; void post(Reader& nif) override;
}; };
struct bhkBlendController : public Controller struct bhkBlendController : public NiTimeController
{ {
void read(NIFStream* nif) override; void read(NIFStream* nif) override;
}; };
@ -314,7 +314,7 @@ namespace Nif
void read(NIFStream* nif) override; void read(NIFStream* nif) override;
}; };
struct NiControllerManager : public Controller struct NiControllerManager : public NiTimeController
{ {
bool mCumulative; bool mCumulative;
NiControllerSequenceList mSequences; NiControllerSequenceList mSequences;

@ -9,7 +9,7 @@ namespace Nif
struct NiParticleModifier : public Record struct NiParticleModifier : public Record
{ {
NiParticleModifierPtr mNext; NiParticleModifierPtr mNext;
ControllerPtr mController; NiTimeControllerPtr mController;
void read(NIFStream* nif) override; void read(NIFStream* nif) override;
void post(Reader& nif) override; void post(Reader& nif) override;

@ -116,7 +116,7 @@ namespace Nif
struct NiUVData; struct NiUVData;
struct NiPosData; struct NiPosData;
struct NiVisData; struct NiVisData;
struct Controller; struct NiTimeController;
struct NiObjectNET; struct NiObjectNET;
struct NiSkinData; struct NiSkinData;
struct NiFloatData; struct NiFloatData;
@ -157,7 +157,7 @@ namespace Nif
using NiUVDataPtr = RecordPtrT<NiUVData>; using NiUVDataPtr = RecordPtrT<NiUVData>;
using NiPosDataPtr = RecordPtrT<NiPosData>; using NiPosDataPtr = RecordPtrT<NiPosData>;
using NiVisDataPtr = RecordPtrT<NiVisData>; using NiVisDataPtr = RecordPtrT<NiVisData>;
using ControllerPtr = RecordPtrT<Controller>; using NiTimeControllerPtr = RecordPtrT<NiTimeController>;
using NiObjectNETPtr = RecordPtrT<NiObjectNET>; using NiObjectNETPtr = RecordPtrT<NiObjectNET>;
using NiSkinDataPtr = RecordPtrT<NiSkinData>; using NiSkinDataPtr = RecordPtrT<NiSkinData>;
using NiMorphDataPtr = RecordPtrT<NiMorphData>; using NiMorphDataPtr = RecordPtrT<NiMorphData>;

@ -255,7 +255,7 @@ namespace NifBullet
if (node.recType == Nif::RC_NiCollisionSwitch && !node.collisionActive()) if (node.recType == Nif::RC_NiCollisionSwitch && !node.collisionActive())
return; return;
for (Nif::ControllerPtr ctrl = node.mController; !ctrl.empty(); ctrl = ctrl->next) for (Nif::NiTimeControllerPtr ctrl = node.mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
if (args.mAnimated) if (args.mAnimated)
break; break;

@ -15,11 +15,11 @@
namespace NifOsg namespace NifOsg
{ {
ControllerFunction::ControllerFunction(const Nif::Controller* ctrl) ControllerFunction::ControllerFunction(const Nif::NiTimeController* ctrl)
: mFrequency(ctrl->frequency) : mFrequency(ctrl->mFrequency)
, mPhase(ctrl->phase) , mPhase(ctrl->mPhase)
, mStartTime(ctrl->timeStart) , mStartTime(ctrl->mTimeStart)
, mStopTime(ctrl->timeStop) , mStopTime(ctrl->mTimeStop)
, mExtrapolationMode(ctrl->extrapolationMode()) , mExtrapolationMode(ctrl->extrapolationMode())
{ {
} }
@ -31,7 +31,7 @@ namespace NifOsg
return time; return time;
switch (mExtrapolationMode) switch (mExtrapolationMode)
{ {
case Nif::Controller::ExtrapolationMode::Cycle: case Nif::NiTimeController::ExtrapolationMode::Cycle:
{ {
float delta = mStopTime - mStartTime; float delta = mStopTime - mStartTime;
if (delta <= 0) if (delta <= 0)
@ -40,7 +40,7 @@ namespace NifOsg
float remainder = (cycles - std::floor(cycles)) * delta; float remainder = (cycles - std::floor(cycles)) * delta;
return mStartTime + remainder; return mStartTime + remainder;
} }
case Nif::Controller::ExtrapolationMode::Reverse: case Nif::NiTimeController::ExtrapolationMode::Reverse:
{ {
float delta = mStopTime - mStartTime; float delta = mStopTime - mStartTime;
if (delta <= 0) if (delta <= 0)
@ -55,7 +55,7 @@ namespace NifOsg
return mStopTime - remainder; return mStopTime - remainder;
} }
case Nif::Controller::ExtrapolationMode::Constant: case Nif::NiTimeController::ExtrapolationMode::Constant:
default: default:
return std::clamp(time, mStartTime, mStopTime); return std::clamp(time, mStartTime, mStopTime);
} }

@ -191,10 +191,10 @@ namespace NifOsg
float mPhase; float mPhase;
float mStartTime; float mStartTime;
float mStopTime; float mStopTime;
Nif::Controller::ExtrapolationMode mExtrapolationMode; Nif::NiTimeController::ExtrapolationMode mExtrapolationMode;
public: public:
ControllerFunction(const Nif::Controller* ctrl); ControllerFunction(const Nif::NiTimeController* ctrl);
float calculate(float value) const override; float calculate(float value) const override;

@ -293,8 +293,8 @@ namespace NifOsg
auto textKeyExtraData = static_cast<const Nif::NiTextKeyExtraData*>(extraList[0].getPtr()); auto textKeyExtraData = static_cast<const Nif::NiTextKeyExtraData*>(extraList[0].getPtr());
extractTextKeys(textKeyExtraData, target.mTextKeys); extractTextKeys(textKeyExtraData, target.mTextKeys);
Nif::ControllerPtr ctrl = seq->mController; Nif::NiTimeControllerPtr ctrl = seq->mController;
for (size_t i = 1; i < extraList.size() && !ctrl.empty(); i++, (ctrl = ctrl->next)) for (size_t i = 1; i < extraList.size() && !ctrl.empty(); i++, (ctrl = ctrl->mNext))
{ {
Nif::ExtraPtr extra = extraList[i]; Nif::ExtraPtr extra = extraList[i];
if (extra->recType != Nif::RC_NiStringExtraData || ctrl->recType != Nif::RC_NiKeyframeController) if (extra->recType != Nif::RC_NiStringExtraData || ctrl->recType != Nif::RC_NiKeyframeController)
@ -449,7 +449,7 @@ namespace NifOsg
animflags, hasStencilProperty); animflags, hasStencilProperty);
} }
static void setupController(const Nif::Controller* ctrl, SceneUtil::Controller* toSetup, int animflags) static void setupController(const Nif::NiTimeController* ctrl, SceneUtil::Controller* toSetup, int animflags)
{ {
bool autoPlay = animflags & Nif::NiNode::AnimFlag_AutoPlay; bool autoPlay = animflags & Nif::NiNode::AnimFlag_AutoPlay;
if (autoPlay) if (autoPlay)
@ -725,7 +725,7 @@ namespace NifOsg
if (nifNode->isHidden()) if (nifNode->isHidden())
{ {
bool hasVisController = false; bool hasVisController = false;
for (Nif::ControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->next) for (Nif::NiTimeControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
hasVisController |= (ctrl->recType == Nif::RC_NiVisController); hasVisController |= (ctrl->recType == Nif::RC_NiVisController);
if (hasVisController) if (hasVisController)
@ -858,7 +858,7 @@ namespace NifOsg
SceneUtil::CompositeStateSetUpdater* composite, const std::vector<unsigned int>& boundTextures, SceneUtil::CompositeStateSetUpdater* composite, const std::vector<unsigned int>& boundTextures,
int animflags) int animflags)
{ {
for (Nif::ControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->next) for (Nif::NiTimeControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
@ -884,7 +884,7 @@ namespace NifOsg
void handleNodeControllers(const Nif::NiAVObject* nifNode, osg::Node* node, int animflags, bool& isAnimated) void handleNodeControllers(const Nif::NiAVObject* nifNode, osg::Node* node, int animflags, bool& isAnimated)
{ {
for (Nif::ControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->next) for (Nif::NiTimeControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
@ -962,7 +962,7 @@ namespace NifOsg
void handleMaterialControllers(const Nif::Property* materialProperty, void handleMaterialControllers(const Nif::Property* materialProperty,
SceneUtil::CompositeStateSetUpdater* composite, int animflags, const osg::Material* baseMaterial) SceneUtil::CompositeStateSetUpdater* composite, int animflags, const osg::Material* baseMaterial)
{ {
for (Nif::ControllerPtr ctrl = materialProperty->mController; !ctrl.empty(); ctrl = ctrl->next) for (Nif::NiTimeControllerPtr ctrl = materialProperty->mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
@ -1012,7 +1012,7 @@ namespace NifOsg
void handleTextureControllers(const Nif::Property* texProperty, SceneUtil::CompositeStateSetUpdater* composite, void handleTextureControllers(const Nif::Property* texProperty, SceneUtil::CompositeStateSetUpdater* composite,
Resource::ImageManager* imageManager, osg::StateSet* stateset, int animflags) Resource::ImageManager* imageManager, osg::StateSet* stateset, int animflags)
{ {
for (Nif::ControllerPtr ctrl = texProperty->mController; !ctrl.empty(); ctrl = ctrl->next) for (Nif::NiTimeControllerPtr ctrl = texProperty->mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
@ -1200,7 +1200,7 @@ namespace NifOsg
partctrl->horizontalAngle, partctrl->verticalDir, partctrl->verticalAngle, partctrl->lifetime, partctrl->horizontalAngle, partctrl->verticalDir, partctrl->verticalAngle, partctrl->lifetime,
partctrl->lifetimeRandom); partctrl->lifetimeRandom);
emitter->setShooter(shooter); emitter->setShooter(shooter);
emitter->setFlags(partctrl->flags); emitter->setFlags(partctrl->mFlags);
if (partctrl->recType == Nif::RC_NiBSPArrayController && partctrl->emitAtVertex()) if (partctrl->recType == Nif::RC_NiBSPArrayController && partctrl->emitAtVertex())
{ {
@ -1252,7 +1252,7 @@ namespace NifOsg
partsys->setSortMode(osgParticle::ParticleSystem::SORT_BACK_TO_FRONT); partsys->setSortMode(osgParticle::ParticleSystem::SORT_BACK_TO_FRONT);
const Nif::NiParticleSystemController* partctrl = nullptr; const Nif::NiParticleSystemController* partctrl = nullptr;
for (Nif::ControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->next) for (Nif::NiTimeControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;
@ -1483,7 +1483,7 @@ namespace NifOsg
if (geom->empty()) if (geom->empty())
return; return;
osg::ref_ptr<osg::Drawable> drawable; osg::ref_ptr<osg::Drawable> drawable;
for (Nif::ControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->next) for (Nif::NiTimeControllerPtr ctrl = nifNode->mController; !ctrl.empty(); ctrl = ctrl->mNext)
{ {
if (!ctrl->isActive()) if (!ctrl->isActive())
continue; continue;

Loading…
Cancel
Save