use particle data for particle system quota

pull/3088/head
glassmancody.info 4 years ago
parent d843ec321e
commit 4bbbbb00f6

@ -123,6 +123,7 @@
Bug #5995: NiUVController doesn't calculate the UV offset properly
Bug #6007: Crash when ending cutscene is playing
Bug #6016: Greeting interrupts Fargoth's sneak-walk
Bug #6028: Particle system controller values are incorrectly used
Feature #390: 3rd person look "over the shoulder"
Feature #832: OpenMW-CS: Handle deleted references
Feature #1536: Show more information about level on menu

@ -954,13 +954,17 @@ namespace NifOsg
}
// Load the initial state of the particle system, i.e. the initial particles and their positions, velocity and colors.
void handleParticleInitialState(const Nif::Node* nifNode, osgParticle::ParticleSystem* partsys, const Nif::NiParticleSystemController* partctrl)
void handleParticleInitialState(const Nif::Node* nifNode, ParticleSystem* partsys, const Nif::NiParticleSystemController* partctrl)
{
auto particleNode = static_cast<const Nif::NiParticles*>(nifNode);
if (particleNode->data.empty() || particleNode->data->recType != Nif::RC_NiParticlesData)
{
partsys->setQuota(partctrl->numParticles);
return;
}
auto particledata = static_cast<const Nif::NiParticlesData*>(particleNode->data.getPtr());
partsys->setQuota(particledata->numParticles);
osg::BoundingBox box;
@ -1095,8 +1099,6 @@ namespace NifOsg
handleParticleInitialState(nifNode, partsys, partctrl);
partsys->setQuota(partctrl->numParticles);
partsys->getDefaultParticleTemplate().setSizeRange(osgParticle::rangef(partctrl->size, partctrl->size));
partsys->getDefaultParticleTemplate().setColorRange(osgParticle::rangev4(osg::Vec4f(1.f,1.f,1.f,1.f), osg::Vec4f(1.f,1.f,1.f,1.f)));
partsys->getDefaultParticleTemplate().setAlphaRange(osgParticle::rangef(1.f, 1.f));

Loading…
Cancel
Save