1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 18:59:57 +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

@ -47,7 +47,6 @@ namespace SceneUtil
/// @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();