From 1adce8afb30743d3dfd99d2d8a0112c058f4080a Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 22 Aug 2013 10:47:15 +0200 Subject: [PATCH] Fix ambient light getting set from the cell data for non-interior cells --- apps/openmw/mwrender/renderingmanager.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 32ddd8b5f..ade871a94 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -547,7 +547,8 @@ void RenderingManager::setAmbientMode() void RenderingManager::configureAmbient(MWWorld::Ptr::CellStore &mCell) { - mAmbientColor.setAsABGR (mCell.mCell->mAmbi.mAmbient); + if (mCell.mCell->mData.mFlags & ESM::Cell::Interior) + mAmbientColor.setAsABGR (mCell.mCell->mAmbi.mAmbient); setAmbientMode(); // Create a "sun" that shines light downwards. It doesn't look @@ -555,12 +556,15 @@ void RenderingManager::configureAmbient(MWWorld::Ptr::CellStore &mCell) if(!mSun) { mSun = mRendering.getScene()->createLight(); + mSun->setType(Ogre::Light::LT_DIRECTIONAL); + } + if (mCell.mCell->mData.mFlags & ESM::Cell::Interior) + { + Ogre::ColourValue colour; + colour.setAsABGR (mCell.mCell->mAmbi.mSunlight); + mSun->setDiffuseColour (colour); + mSun->setDirection(0,-1,0); } - Ogre::ColourValue colour; - colour.setAsABGR (mCell.mCell->mAmbi.mSunlight); - mSun->setDiffuseColour (colour); - mSun->setType(Ogre::Light::LT_DIRECTIONAL); - mSun->setDirection(0,-1,0); } // Switch through lighting modes.