1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-05 16:45:34 +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) , mEnabled(true)
, mSunEnabled(true) , mSunEnabled(true)
, mPrecipitationAlpha(0.f) , mPrecipitationAlpha(0.f)
, mDirtyParticlesEffect(false)
{ {
osg::ref_ptr<CameraRelativeTransform> skyroot = new CameraRelativeTransform; osg::ref_ptr<CameraRelativeTransform> skyroot = new CameraRelativeTransform;
skyroot->setName("Sky Root"); skyroot->setName("Sky Root");
@ -537,8 +538,7 @@ namespace MWRender
if (!enabled && mParticleNode && mParticleEffect) if (!enabled && mParticleNode && mParticleEffect)
{ {
mCurrentParticleEffect.clear(); mCurrentParticleEffect.clear();
mParticleNode->removeChild(mParticleEffect); mDirtyParticlesEffect = true;
mParticleEffect = nullptr;
} }
mEnabled = enabled; mEnabled = enabled;
@ -610,8 +610,9 @@ namespace MWRender
if (mIsStorm) if (mIsStorm)
mStormDirection = weather.mStormDirection; mStormDirection = weather.mStormDirection;
if (mCurrentParticleEffect != weather.mParticleEffect) if (mDirtyParticlesEffect || (mCurrentParticleEffect != weather.mParticleEffect))
{ {
mDirtyParticlesEffect = false;
mCurrentParticleEffect = weather.mParticleEffect; mCurrentParticleEffect = weather.mParticleEffect;
// cleanup old particles // cleanup old particles

View file

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