Fix lights being rendered on the map (broken by d55fe43fc9)

moveref
scrawl 10 years ago
parent 99ae0f901b
commit 5d7eb11596

@ -198,4 +198,18 @@ void Actors::updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur)
mRendering->updateWaterRippleEmitterPtr (old, cur);
}
void Actors::enableLights()
{
PtrAnimationMap::const_iterator it = mAllActors.begin();
for(;it != mAllActors.end();++it)
it->second->enableLights(true);
}
void Actors::disableLights()
{
PtrAnimationMap::const_iterator it = mAllActors.begin();
for(;it != mAllActors.end();++it)
it->second->enableLights(false);
}
}

@ -42,9 +42,12 @@ namespace MWRender
void insertNPC(const MWWorld::Ptr& ptr);
void insertCreature (const MWWorld::Ptr& ptr, bool weaponsShields);
void insertActivator (const MWWorld::Ptr& ptr, bool addLight=false);
bool deleteObject (const MWWorld::Ptr& ptr);
bool deleteObject (const MWWorld::Ptr& ptr);
///< \return found?
void enableLights();
void disableLights();
void removeCell(MWWorld::CellStore* store);
void update (Ogre::Camera* camera);

@ -237,20 +237,6 @@ Ogre::AxisAlignedBox Objects::getDimensions(MWWorld::CellStore* cell)
return mBounds[cell];
}
void Objects::enableLights()
{
PtrAnimationMap::const_iterator it = mObjects.begin();
for(;it != mObjects.end();++it)
it->second->enableLights(true);
}
void Objects::disableLights()
{
PtrAnimationMap::const_iterator it = mObjects.begin();
for(;it != mObjects.end();++it)
it->second->enableLights(false);
}
void Objects::update(float dt, Ogre::Camera* camera)
{
PtrAnimationMap::const_iterator it = mObjects.begin();

@ -45,9 +45,6 @@ public:
ObjectAnimation* getAnimation(const MWWorld::Ptr &ptr);
void enableLights();
void disableLights();
void update (float dt, Ogre::Camera* camera);
///< per-frame update

@ -677,13 +677,13 @@ void RenderingManager::writeFog(MWWorld::CellStore* cell)
void RenderingManager::disableLights(bool sun)
{
mObjects->disableLights();
mActors->disableLights();
sunDisable(sun);
}
void RenderingManager::enableLights(bool sun)
{
mObjects->enableLights();
mActors->enableLights();
sunEnable(sun);
}

Loading…
Cancel
Save