Read BSPSysMultiTargetEmitterCtlr and bone LOD controllers

macos_ci_fix
Alexei Kotov 1 year ago
parent d048746146
commit 3296dadf60

@ -460,6 +460,50 @@ namespace Nif
mData.post(nif);
}
void NiBoneLODController::read(NIFStream* nif)
{
NiTimeController::read(nif);
nif->read(mLOD);
mNodeGroups.resize(nif->get<uint32_t>());
nif->read(mNumNodeGroups);
for (NiAVObjectList& group : mNodeGroups)
readRecordList(nif, group);
if (nif->getBethVersion() != 0 || nif->getVersion() < NIFStream::generateVersion(4, 2, 2, 0))
return;
mSkinnedShapeGroups.resize(nif->get<uint32_t>());
for (std::vector<SkinInfo>& group : mSkinnedShapeGroups)
{
group.resize(nif->get<uint32_t>());
for (SkinInfo& info : group)
{
info.mShape.read(nif);
info.mSkin.read(nif);
}
}
readRecordList(nif, mShapeGroups);
}
void NiBoneLODController::post(Reader& nif)
{
NiTimeController::post(nif);
for (NiAVObjectList& group : mNodeGroups)
postRecordList(nif, group);
for (std::vector<SkinInfo>& group : mSkinnedShapeGroups)
{
for (SkinInfo& info : group)
{
info.mShape.post(nif);
info.mSkin.post(nif);
}
}
postRecordList(nif, mShapeGroups);
}
void bhkBlendController::read(NIFStream* nif)
{
NiTimeController::read(nif);

@ -300,6 +300,24 @@ namespace Nif
void post(Reader& nif) override;
};
struct NiBoneLODController : NiTimeController
{
struct SkinInfo
{
NiTriBasedGeomPtr mShape;
NiSkinInstancePtr mSkin;
};
uint32_t mLOD;
uint32_t mNumNodeGroups;
std::vector<NiAVObjectList> mNodeGroups;
std::vector<std::vector<SkinInfo>> mSkinnedShapeGroups;
NiTriBasedGeomList mShapeGroups;
void read(NIFStream* nif) override;
void post(Reader& nif) override;
};
struct bhkBlendController : public NiTimeController
{
void read(NIFStream* nif) override;

@ -118,6 +118,7 @@ namespace Nif
{ "NiVisController", &construct<NiVisController, RC_NiVisController> },
// Gamebryo
{ "NiBoneLODController", &construct<NiBoneLODController, RC_NiBoneLODController> },
{ "NiControllerManager", &construct<NiControllerManager, RC_NiControllerManager> },
{ "NiLightDimmerController", &construct<NiFloatInterpController, RC_NiLightDimmerController> },
{ "NiTransformController", &construct<NiKeyframeController, RC_NiKeyframeController> },
@ -154,6 +155,7 @@ namespace Nif
{ "BSLightingShaderPropertyFloatController",
&construct<BSEffectShaderPropertyFloatController, RC_BSLightingShaderPropertyFloatController> },
{ "bhkBlendController", &construct<bhkBlendController, RC_bhkBlendController> },
{ "NiBSBoneLODController", &construct<NiBoneLODController, RC_NiBoneLODController> },
// Interpolators, Gamebryo
{ "NiBlendBoolInterpolator", &construct<NiBlendBoolInterpolator, RC_NiBlendBoolInterpolator> },
@ -353,6 +355,9 @@ namespace Nif
{ "NiPSysInitialRotAngleVarCtlr", &construct<NiPSysModifierFloatCtlr, RC_NiPSysInitialRotAngleVarCtlr> },
{ "NiPSysModifierActiveCtlr", &construct<NiPSysModifierBoolCtlr, RC_NiPSysModifierActiveCtlr> },
// Modifier controllers, Bethesda
{ "BSPSysMultiTargetEmitterCtlr", &construct<BSPSysMultiTargetEmitterCtlr, RC_BSPSysMultiTargetEmitterCtlr> },
// Modifier controller data, Gamebryo
{ "NiPSysEmitterCtlrData", &construct<NiPSysEmitterCtlrData, RC_NiPSysEmitterCtlrData> },

@ -597,6 +597,21 @@ namespace Nif
mVisInterpolator.post(nif);
}
void BSPSysMultiTargetEmitterCtlr::read(NIFStream* nif)
{
NiPSysEmitterCtlr::read(nif);
nif->read(mMaxEmitters);
mMasterPSys.read(nif);
}
void BSPSysMultiTargetEmitterCtlr::post(Reader& nif)
{
NiPSysEmitterCtlr::post(nif);
mMasterPSys.post(nif);
}
void NiPSysEmitterCtlrData::read(NIFStream* nif)
{
mFloatKeyList = std::make_shared<FloatKeyMap>();

@ -476,6 +476,15 @@ namespace Nif
void post(Reader& nif) override;
};
struct BSPSysMultiTargetEmitterCtlr : NiPSysEmitterCtlr
{
uint16_t mMaxEmitters;
BSMasterParticleSystemPtr mMasterPSys;
void read(NIFStream* nif) override;
void post(Reader& nif) override;
};
struct NiPSysEmitterCtlrData : Record
{
FloatKeyMapPtr mFloatKeyList;

@ -98,6 +98,7 @@ namespace Nif
RC_BSPSysArrayEmitter,
RC_BSPSysInheritVelocityModifier,
RC_BSPSysLODModifier,
RC_BSPSysMultiTargetEmitterCtlr,
RC_BSPSysRecycleBoundModifier,
RC_BSPSysScaleModifier,
RC_BSPSysSimpleColorModifier,
@ -130,6 +131,7 @@ namespace Nif
RC_NiBlendFloatInterpolator,
RC_NiBlendPoint3Interpolator,
RC_NiBlendTransformInterpolator,
RC_NiBoneLODController,
RC_NiBoolData,
RC_NiBooleanExtraData,
RC_NiBoolInterpolator,

@ -129,6 +129,7 @@ namespace Nif
struct NiSourceTexture;
struct NiPalette;
struct NiParticleModifier;
struct BSMasterParticleSystem;
struct NiParticleSystem;
struct NiPSysCollider;
struct NiPSysColliderManager;
@ -138,6 +139,7 @@ namespace Nif
struct NiBoolData;
struct NiSkinPartition;
struct BSShaderTextureSet;
struct NiTriBasedGeom;
struct NiGeometryData;
struct BSShaderProperty;
struct NiAlphaProperty;
@ -177,6 +179,7 @@ namespace Nif
using NiSourceTexturePtr = RecordPtrT<NiSourceTexture>;
using NiPalettePtr = RecordPtrT<NiPalette>;
using NiParticleModifierPtr = RecordPtrT<NiParticleModifier>;
using BSMasterParticleSystemPtr = RecordPtrT<BSMasterParticleSystem>;
using NiParticleSystemPtr = RecordPtrT<NiParticleSystem>;
using NiPSysColliderPtr = RecordPtrT<NiPSysCollider>;
using NiPSysColliderManagerPtr = RecordPtrT<NiPSysColliderManager>;
@ -185,6 +188,7 @@ namespace Nif
using NiBoolDataPtr = RecordPtrT<NiBoolData>;
using NiSkinPartitionPtr = RecordPtrT<NiSkinPartition>;
using BSShaderTextureSetPtr = RecordPtrT<BSShaderTextureSet>;
using NiTriBasedGeomPtr = RecordPtrT<NiTriBasedGeom>;
using NiGeometryDataPtr = RecordPtrT<NiGeometryData>;
using BSShaderPropertyPtr = RecordPtrT<BSShaderProperty>;
using NiAlphaPropertyPtr = RecordPtrT<NiAlphaProperty>;
@ -216,6 +220,7 @@ namespace Nif
using bhkEntityList = RecordListT<bhkEntity>;
using NiControllerSequenceList = RecordListT<NiControllerSequence>;
using NiPSysModifierList = RecordListT<NiPSysModifier>;
using NiTriBasedGeomList = RecordListT<NiTriBasedGeom>;
} // Namespace
#endif

Loading…
Cancel
Save