fix underwater effect staying active when teleporting from underwater to a cell that doesn't have water

This commit is contained in:
scrawl 2012-04-19 23:25:58 +02:00
parent c6da3872b4
commit 7400b7f313
2 changed files with 8 additions and 1 deletions

View file

@ -512,11 +512,13 @@ Shadows* RenderingManager::getShadows()
void RenderingManager::switchToInterior()
{
mObjects.setInterior(true);
mRendering.getScene()->setCameraRelativeRendering(false);
}
void RenderingManager::switchToExterior()
{
mObjects.setInterior(false);
mRendering.getScene()->setCameraRelativeRendering(true);
}
} // namespace

View file

@ -176,7 +176,12 @@ void Water::toggle()
void Water::checkUnderwater(float y)
{
if (!mActive) return;
if (!mActive)
{
CompositorManager::getSingleton().setCompositorEnabled(mViewport, mCompositorName, false);
return;
}
if ((mIsUnderwater && y > mTop) || !mWater->isVisible() || mCamera->getPolygonMode() != Ogre::PM_SOLID)
{
CompositorManager::getSingleton().setCompositorEnabled(mViewport, mCompositorName, false);