forked from teamnwah/openmw-tes3coop
Fix double update traversal in screenshot function
This commit is contained in:
parent
6e69808129
commit
2407f393ce
1 changed files with 10 additions and 0 deletions
|
@ -489,6 +489,15 @@ namespace MWRender
|
||||||
mutable bool mDone;
|
mutable bool mDone;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class NoTraverseCallback : public osg::NodeCallback
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void RenderingManager::screenshot(osg::Image *image, int w, int h)
|
void RenderingManager::screenshot(osg::Image *image, int w, int h)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Camera> rttCamera (new osg::Camera);
|
osg::ref_ptr<osg::Camera> rttCamera (new osg::Camera);
|
||||||
|
@ -512,6 +521,7 @@ namespace MWRender
|
||||||
image->setDataType(GL_UNSIGNED_BYTE);
|
image->setDataType(GL_UNSIGNED_BYTE);
|
||||||
image->setPixelFormat(texture->getInternalFormat());
|
image->setPixelFormat(texture->getInternalFormat());
|
||||||
|
|
||||||
|
rttCamera->setUpdateCallback(new NoTraverseCallback);
|
||||||
rttCamera->addChild(mLightRoot);
|
rttCamera->addChild(mLightRoot);
|
||||||
rttCamera->setCullMask(mViewer->getCamera()->getCullMask() & (~Mask_GUI));
|
rttCamera->setCullMask(mViewer->getCamera()->getCullMask() & (~Mask_GUI));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue