Fix ambient handling.

This commit is contained in:
Vincent Lejeune 2014-08-09 01:41:30 +02:00
parent 54c9f32033
commit 41cca2e56e
4 changed files with 2 additions and 6 deletions

View File

@ -669,7 +669,6 @@ void Camera::activate()
{
irr::scene::ISceneManager *sm = irr_driver->getSceneManager();
sm->setActiveCamera(m_camera);
sm->setAmbientLight(m_ambient_light);
irr_driver->getVideoDriver()->setViewPort(m_viewport);
} // activate

View File

@ -1623,15 +1623,13 @@ void IrrDriver::onUnloadWorld()
*/
void IrrDriver::setAmbientLight(const video::SColorf &light)
{
printf("redval %f\n", light.getRed());
m_scene_manager->setAmbientLight(light);
m_ambient = light;
m_SH_dirty = true;
} // setAmbientLight
video::SColorf IrrDriver::getAmbientLight() const
{
return m_ambient;
return m_scene_manager->getAmbientLight();
}
// ----------------------------------------------------------------------------

View File

@ -341,7 +341,6 @@ private:
std::vector<BloomData> m_forcedbloom;
std::vector<scene::ISceneNode *> m_background;
video::SColorf m_ambient;
STKRenderingPass m_phase;

View File

@ -485,7 +485,7 @@ void IrrDriver::generateDiffuseCoefficients()
int sh_w = 16;
int sh_h = 16;
video::SColor ambient = m_ambient.toSColor();
video::SColor ambient = m_scene_manager->getAmbientLight().toSColor();
unsigned char *sh_rgba[6];
for (unsigned i = 0; i < 6; i++)