1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-16 07:10:08 +00:00

resets state updater to apply light settings (#3141)

resets state updater to apply light settings

With this PR we achieve the same effect with fewer lines of code.
This commit is contained in:
Bo Svensson 2021-10-06 09:15:47 +00:00 committed by Bret Curtis
parent c3f5e8f968
commit 787f91211d
2 changed files with 2 additions and 7 deletions

View File

@ -1281,11 +1281,7 @@ namespace MWRender
defines[name] = key;
mResourceSystem->getSceneManager()->getShaderManager().setGlobalDefines(defines);
mSceneRoot->removeUpdateCallback(mStateUpdater);
mStateUpdater = new StateUpdater;
mSceneRoot->addUpdateCallback(mStateUpdater);
mStateUpdater->setFogEnd(mViewDistance);
updateAmbient();
mStateUpdater->reset();
mViewer->startThreading();
}

View File

@ -46,8 +46,7 @@ namespace SceneUtil
/// Set default state - optionally override in derived classes
/// @par May be used e.g. to allocate StateAttributes.
virtual void setDefaults(osg::StateSet* stateset) {}
protected:
/// Reset mStateSets, forcing a setDefaults() on the next frame. Can be used to change the defaults if needed.
void reset();