1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-05 10:15:35 +00:00

Merge branch 'ripple_fix' into 'master'

Fix persistent ripples (#6531)

Closes #6531

See merge request OpenMW/openmw!1535
This commit is contained in:
psi29a 2022-01-05 08:37:27 +00:00
commit d8cc08a7a0
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;
};