From 711912dacee93d1b2a180473e62e7ffbfdc437ba Mon Sep 17 00:00:00 2001 From: Florent Malartre Date: Tue, 23 Jun 2020 18:09:18 +0200 Subject: [PATCH] Lights are enabled instead of putted back to what they were --- OgreMain/src/OgreForward3D.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OgreMain/src/OgreForward3D.cpp b/OgreMain/src/OgreForward3D.cpp index 6cc2233d1..751f237c5 100644 --- a/OgreMain/src/OgreForward3D.cpp +++ b/OgreMain/src/OgreForward3D.cpp @@ -42,6 +42,8 @@ THE SOFTWARE. #include "OgreProfiler.h" +#include + namespace Ogre { Forward3D::Forward3D( uint32 width, uint32 height, @@ -150,10 +152,15 @@ namespace Ogre LightClosestArray::const_iterator itor = shadowCastingLights.begin(); LightClosestArray::const_iterator end = shadowCastingLights.end(); + std::queue savedVisible; + while( itor != end ) { if( itor->light ) + { + savedVisible.push(itor->light->isVisible() ); itor->light->setVisible( false ); + } ++itor; } @@ -167,7 +174,10 @@ namespace Ogre while( itor != end ) { if( itor->light ) - itor->light->setVisible( true ); + { + itor->light->setVisible( savedVisible.front() ); + savedVisible.pop(); + } ++itor; } } -- 2.17.1