From 7400b7f313d8cbc7141ca89d926be3dc42dca9be Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 19 Apr 2012 23:25:58 +0200 Subject: [PATCH] fix underwater effect staying active when teleporting from underwater to a cell that doesn't have water --- apps/openmw/mwrender/renderingmanager.cpp | 2 ++ apps/openmw/mwrender/water.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 5232c5140..3f1bb924f 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -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 diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 445677808..c81f23f54 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -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);