mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Do not lose existing callbacks for sky node
This commit is contained in:
parent
7d6c33d283
commit
aad7c5066d
@ -147,7 +147,8 @@ namespace MWRender
|
||||
|
||||
void PrecipitationOccluder::enable()
|
||||
{
|
||||
mSkyNode->setCullCallback(new PrecipitationOcclusionUpdater(mDepthTexture));
|
||||
mSkyCullCallback = new PrecipitationOcclusionUpdater(mDepthTexture);
|
||||
mSkyNode->addCullCallback(mSkyCullCallback);
|
||||
mCamera->setCullCallback(new DepthCameraUpdater);
|
||||
|
||||
mRootNode->removeChild(mCamera);
|
||||
@ -156,8 +157,9 @@ namespace MWRender
|
||||
|
||||
void PrecipitationOccluder::disable()
|
||||
{
|
||||
mSkyNode->setCullCallback(nullptr);
|
||||
mSkyNode->removeCullCallback(mSkyCullCallback);
|
||||
mCamera->setCullCallback(nullptr);
|
||||
mSkyCullCallback = nullptr;
|
||||
|
||||
mRootNode->removeChild(mCamera);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ namespace MWRender
|
||||
osg::Group* mSkyNode;
|
||||
osg::Group* mSceneNode;
|
||||
osg::Group* mRootNode;
|
||||
osg::ref_ptr<osg::Callback> mSkyCullCallback;
|
||||
osg::ref_ptr<osg::Camera> mCamera;
|
||||
osg::ref_ptr<osg::Camera> mSceneCamera;
|
||||
osg::ref_ptr<osg::Texture2D> mDepthTexture;
|
||||
|
Loading…
Reference in New Issue
Block a user