forked from mirror/openmw-tes3mp
some ambient light cleanup
This commit is contained in:
parent
1b6b4e3442
commit
205354ba30
3 changed files with 6 additions and 10 deletions
|
@ -32,11 +32,7 @@ namespace CSVRender
|
||||||
|
|
||||||
mSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
|
mSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
|
||||||
|
|
||||||
// Throw in a random color just to make sure multiple scenes work
|
mSceneMgr->setAmbientLight (Ogre::ColourValue (0,0,0,1));
|
||||||
Ogre::Real r = Ogre::Math::RangeRandom(0, 1);
|
|
||||||
Ogre::Real g = Ogre::Math::RangeRandom(0, 1);
|
|
||||||
Ogre::Real b = Ogre::Math::RangeRandom(0, 1);
|
|
||||||
mSceneMgr->setAmbientLight(Ogre::ColourValue(r,g,b,1));
|
|
||||||
|
|
||||||
Ogre::Light* l = mSceneMgr->createLight();
|
Ogre::Light* l = mSceneMgr->createLight();
|
||||||
l->setType (Ogre::Light::LT_DIRECTIONAL);
|
l->setType (Ogre::Light::LT_DIRECTIONAL);
|
||||||
|
@ -57,7 +53,7 @@ namespace CSVRender
|
||||||
timer->start (20); /// \todo make this configurable
|
timer->start (20); /// \todo make this configurable
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneWidget::setAmbient (const Ogre::ColourValue& colour)
|
void SceneWidget::setDefaultAmbient (const Ogre::ColourValue& colour)
|
||||||
{
|
{
|
||||||
mSceneMgr->setAmbientLight (colour);
|
mSceneMgr->setAmbientLight (colour);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,6 @@ namespace CSVRender
|
||||||
|
|
||||||
QPaintEngine* paintEngine() const;
|
QPaintEngine* paintEngine() const;
|
||||||
|
|
||||||
void setAmbient (const Ogre::ColourValue& colour);
|
|
||||||
///< \note The actual ambient colour may differ based on lighting settings.
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void setNavigation (Navigation *navigation);
|
void setNavigation (Navigation *navigation);
|
||||||
|
@ -38,6 +35,9 @@ namespace CSVRender
|
||||||
|
|
||||||
void flagAsModified();
|
void flagAsModified();
|
||||||
|
|
||||||
|
void setDefaultAmbient (const Ogre::ColourValue& colour);
|
||||||
|
///< \note The actual ambient colour may differ based on lighting settings.
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void paintEvent(QPaintEvent* e);
|
void paintEvent(QPaintEvent* e);
|
||||||
void resizeEvent(QResizeEvent* e);
|
void resizeEvent(QResizeEvent* e);
|
||||||
|
|
|
@ -15,7 +15,7 @@ void CSVRender::UnpagedWorldspaceWidget::update()
|
||||||
|
|
||||||
Ogre::ColourValue colour;
|
Ogre::ColourValue colour;
|
||||||
colour.setAsABGR (record.get().mAmbi.mAmbient);
|
colour.setAsABGR (record.get().mAmbi.mAmbient);
|
||||||
setAmbient (colour);
|
setDefaultAmbient (colour);
|
||||||
|
|
||||||
/// \todo deal with mSunlight and mFog/mForDensity
|
/// \todo deal with mSunlight and mFog/mForDensity
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue