1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:23:53 +00:00

update sky particle node correctly

This commit is contained in:
glassmancody.info 2022-01-04 14:10:39 -08:00
parent b6572fbe42
commit 909aa43ba1
2 changed files with 5 additions and 3 deletions

View file

@ -248,6 +248,7 @@ namespace MWRender
, mEnabled(true)
, mSunEnabled(true)
, mPrecipitationAlpha(0.f)
, mDirtyParticlesEffect(false)
{
osg::ref_ptr<CameraRelativeTransform> skyroot = new CameraRelativeTransform;
skyroot->setName("Sky Root");
@ -537,8 +538,7 @@ namespace MWRender
if (!enabled && mParticleNode && mParticleEffect)
{
mCurrentParticleEffect.clear();
mParticleNode->removeChild(mParticleEffect);
mParticleEffect = nullptr;
mDirtyParticlesEffect = true;
}
mEnabled = enabled;
@ -610,8 +610,9 @@ namespace MWRender
if (mIsStorm)
mStormDirection = weather.mStormDirection;
if (mCurrentParticleEffect != weather.mParticleEffect)
if (mDirtyParticlesEffect || (mCurrentParticleEffect != weather.mParticleEffect))
{
mDirtyParticlesEffect = false;
mCurrentParticleEffect = weather.mParticleEffect;
// cleanup old particles

View file

@ -186,6 +186,7 @@ namespace MWRender
bool mSunEnabled;
float mPrecipitationAlpha;
bool mDirtyParticlesEffect;
osg::Vec4f mMoonScriptColor;
};