mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:53:53 +00:00
Fix ambient light getting set from the cell data for non-interior cells
This commit is contained in:
parent
dc6e15f38e
commit
1adce8afb3
1 changed files with 10 additions and 6 deletions
|
@ -547,7 +547,8 @@ void RenderingManager::setAmbientMode()
|
||||||
|
|
||||||
void RenderingManager::configureAmbient(MWWorld::Ptr::CellStore &mCell)
|
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();
|
setAmbientMode();
|
||||||
|
|
||||||
// Create a "sun" that shines light downwards. It doesn't look
|
// Create a "sun" that shines light downwards. It doesn't look
|
||||||
|
@ -555,12 +556,15 @@ void RenderingManager::configureAmbient(MWWorld::Ptr::CellStore &mCell)
|
||||||
if(!mSun)
|
if(!mSun)
|
||||||
{
|
{
|
||||||
mSun = mRendering.getScene()->createLight();
|
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.
|
// Switch through lighting modes.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue