forked from teamnwah/openmw-tes3coop
Work around particles not being rendered in the first frame
This commit is contained in:
parent
c7e1c0b595
commit
84b0dcf2e3
1 changed files with 2 additions and 1 deletions
|
@ -1033,7 +1033,7 @@ class NIFObjectLoader
|
||||||
static void createParticleInitialState(Ogre::ParticleSystem* partsys, const Nif::NiAutoNormalParticlesData* particledata,
|
static void createParticleInitialState(Ogre::ParticleSystem* partsys, const Nif::NiAutoNormalParticlesData* particledata,
|
||||||
const Nif::NiParticleSystemController* partctrl)
|
const Nif::NiParticleSystemController* partctrl)
|
||||||
{
|
{
|
||||||
partsys->_update(0.f); // seems to be required to allocate mFreeParticles
|
partsys->_update(0.f); // seems to be required to allocate mFreeParticles. TODO: patch Ogre to handle this better
|
||||||
int i=0;
|
int i=0;
|
||||||
for (std::vector<Nif::NiParticleSystemController::Particle>::const_iterator it = partctrl->particles.begin();
|
for (std::vector<Nif::NiParticleSystemController::Particle>::const_iterator it = partctrl->particles.begin();
|
||||||
i<particledata->activeCount && it != partctrl->particles.end(); ++it, ++i)
|
i<particledata->activeCount && it != partctrl->particles.end(); ++it, ++i)
|
||||||
|
@ -1073,6 +1073,7 @@ class NIFObjectLoader
|
||||||
totalTimeToLive = std::max(0.f, particle.lifespan);
|
totalTimeToLive = std::max(0.f, particle.lifespan);
|
||||||
timeToLive = std::max(0.f, particle.lifespan - particle.lifetime);
|
timeToLive = std::max(0.f, particle.lifespan - particle.lifetime);
|
||||||
}
|
}
|
||||||
|
partsys->_update(0.f); // now apparently needs another update, otherwise it won't render in the first frame. TODO: patch Ogre to handle this better
|
||||||
}
|
}
|
||||||
|
|
||||||
static void createNodeControllers(const Nif::NIFFilePtr& nif, const std::string &name, Nif::ControllerPtr ctrl, ObjectScenePtr scene, int animflags)
|
static void createNodeControllers(const Nif::NIFFilePtr& nif, const std::string &name, Nif::ControllerPtr ctrl, ObjectScenePtr scene, int animflags)
|
||||||
|
|
Loading…
Reference in a new issue