mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:59:54 +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:
parent
c3f5e8f968
commit
787f91211d
2 changed files with 2 additions and 7 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue