Read NiPSysSpawnModifier, NiPSysAgeDeathModifier

macos_ci_fix
Alexei Kotov 1 year ago
parent eaa82ba5c6
commit b45923ac39

@ -292,6 +292,10 @@ namespace Nif
{ "NiParticleGrowFade", &construct<NiParticleGrowFade, RC_NiParticleGrowFade> },
{ "NiParticleRotation", &construct<NiParticleRotation, RC_NiParticleRotation> },
// Modifiers, Gamebryo
{ "NiPSysAgeDeathModifier", &construct<NiPSysAgeDeathModifier, RC_NiPSysAgeDeathModifier> },
{ "NiPSysSpawnModifier", &construct<NiPSysSpawnModifier, RC_NiPSysSpawnModifier> },
// Modifier controllers, Gamebryo
{ "NiPSysAirFieldAirFrictionCtlr", &construct<NiPSysModifierFloatCtlr, RC_NiPSysAirFieldAirFrictionCtlr> },
{ "NiPSysAirFieldInheritVelocityCtlr",

@ -238,6 +238,35 @@ namespace Nif
mTarget.post(nif);
}
void NiPSysAgeDeathModifier::read(NIFStream* nif)
{
NiPSysModifier::read(nif);
nif->read(mSpawnOnDeath);
mSpawnModifier.read(nif);
}
void NiPSysAgeDeathModifier::post(Reader& nif)
{
NiPSysModifier::post(nif);
mSpawnModifier.post(nif);
}
void NiPSysSpawnModifier::read(NIFStream* nif)
{
NiPSysModifier::read(nif);
nif->read(mNumSpawnGenerations);
nif->read(mPercentageSpawned);
nif->read(mMinNumToSpawn);
nif->read(mMaxNumToSpawn);
nif->read(mSpawnSpeedVariation);
nif->read(mSpawnDirVariation);
nif->read(mLifespan);
nif->read(mLifespanVariation);
}
void NiPSysModifierCtlr::read(NIFStream* nif)
{
NiSingleInterpController::read(nif);

@ -177,6 +177,29 @@ namespace Nif
void post(Reader& nif) override;
};
struct NiPSysAgeDeathModifier : NiPSysModifier
{
bool mSpawnOnDeath;
NiPSysSpawnModifierPtr mSpawnModifier;
void read(NIFStream* nif) override;
void post(Reader& nif) override;
};
struct NiPSysSpawnModifier : NiPSysModifier
{
uint16_t mNumSpawnGenerations;
float mPercentageSpawned;
uint16_t mMinNumToSpawn;
uint16_t mMaxNumToSpawn;
float mSpawnSpeedVariation;
float mSpawnDirVariation;
float mLifespan;
float mLifespanVariation;
void read(NIFStream* nif) override;
};
// Abstract
struct NiPSysModifierCtlr : NiSingleInterpController
{

@ -182,6 +182,7 @@ namespace Nif
RC_NiPlanarCollider,
RC_NiPoint3Interpolator,
RC_NiPosData,
RC_NiPSysAgeDeathModifier,
RC_NiPSysAirFieldAirFrictionCtlr,
RC_NiPSysAirFieldInheritVelocityCtlr,
RC_NiPSysAirFieldSpreadCtlr,
@ -204,6 +205,7 @@ namespace Nif
RC_NiPSysInitialRotAngleCtlr,
RC_NiPSysInitialRotAngleVarCtlr,
RC_NiPSysModifierActiveCtlr,
RC_NiPSysSpawnModifier,
RC_NiPSysUpdateCtlr,
RC_NiRollController,
RC_NiSequence,

@ -132,6 +132,7 @@ namespace Nif
struct NiParticleSystem;
struct NiPSysEmitterCtlrData;
struct NiPSysModifier;
struct NiPSysSpawnModifier;
struct NiBoolData;
struct NiSkinPartition;
struct BSShaderTextureSet;
@ -175,6 +176,7 @@ namespace Nif
using NiParticleModifierPtr = RecordPtrT<NiParticleModifier>;
using NiParticleSystemPtr = RecordPtrT<NiParticleSystem>;
using NiPSysEmitterCtlrDataPtr = RecordPtrT<NiPSysEmitterCtlrData>;
using NiPSysSpawnModifierPtr = RecordPtrT<NiPSysSpawnModifier>;
using NiBoolDataPtr = RecordPtrT<NiBoolData>;
using NiSkinPartitionPtr = RecordPtrT<NiSkinPartition>;
using BSShaderTextureSetPtr = RecordPtrT<BSShaderTextureSet>;

Loading…
Cancel
Save