1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00

Fix the viewport of the character preview being set a frame ahead due to a threading issue

This commit is contained in:
scrawl 2017-07-19 17:43:15 +02:00
parent 20606a2aff
commit 7f634514a8

View File

@ -254,7 +254,10 @@ namespace MWRender
sizeX = std::max(sizeX, 0);
sizeY = std::max(sizeY, 0);
mCamera->setViewport(0, mSizeY-sizeY, std::min(mSizeX, sizeX), std::min(mSizeY, sizeY));
// NB Camera::setViewport has threading issues
osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;
stateset->setAttributeAndModes(new osg::Viewport(0, mSizeY-sizeY, std::min(mSizeX, sizeX), std::min(mSizeY, sizeY)));
mCamera->setStateSet(stateset);
redraw();
}