|
|
|
@ -54,10 +54,12 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
|
|
|
|
cameraPitchNode->attachObject(mRendering.getCamera());
|
|
|
|
|
|
|
|
|
|
mPlayer = new MWRender::Player (mRendering.getCamera(), playerNode);
|
|
|
|
|
mSun = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RenderingManager::~RenderingManager ()
|
|
|
|
|
{
|
|
|
|
|
//TODO: destroy mSun?
|
|
|
|
|
delete mPlayer;
|
|
|
|
|
delete mSkyManager;
|
|
|
|
|
}
|
|
|
|
@ -204,12 +206,15 @@ void RenderingManager::configureAmbient(ESMS::CellStore<MWWorld::RefData> &mCell
|
|
|
|
|
|
|
|
|
|
// Create a "sun" that shines light downwards. It doesn't look
|
|
|
|
|
// completely right, but leave it for now.
|
|
|
|
|
Ogre::Light *light = mRendering.getScene()->createLight();
|
|
|
|
|
if(!mSun)
|
|
|
|
|
{
|
|
|
|
|
mSun = mRendering.getScene()->createLight();
|
|
|
|
|
}
|
|
|
|
|
Ogre::ColourValue colour;
|
|
|
|
|
colour.setAsABGR (mCell.cell->ambi.sunlight);
|
|
|
|
|
light->setDiffuseColour (colour);
|
|
|
|
|
light->setType(Ogre::Light::LT_DIRECTIONAL);
|
|
|
|
|
light->setDirection(0,-1,0);
|
|
|
|
|
mSun->setDiffuseColour (colour);
|
|
|
|
|
mSun->setType(Ogre::Light::LT_DIRECTIONAL);
|
|
|
|
|
mSun->setDirection(0,-1,0);
|
|
|
|
|
}
|
|
|
|
|
// Switch through lighting modes.
|
|
|
|
|
|
|
|
|
|