mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-23 06:41:08 +00:00
update sky particle node correctly
This commit is contained in:
parent
b6572fbe42
commit
909aa43ba1
@ -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
|
||||||
|
@ -186,6 +186,7 @@ namespace MWRender
|
|||||||
bool mSunEnabled;
|
bool mSunEnabled;
|
||||||
|
|
||||||
float mPrecipitationAlpha;
|
float mPrecipitationAlpha;
|
||||||
|
bool mDirtyParticlesEffect;
|
||||||
|
|
||||||
osg::Vec4f mMoonScriptColor;
|
osg::Vec4f mMoonScriptColor;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user