1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

Make sure not to add duplicate viewports (Fixes #1832)

Wasn't a problem while testing reload() on linux. Maybe an implementation difference with Ogre's D3D rendersystem?
This commit is contained in:
scrawl 2014-08-19 19:47:46 +02:00
parent 7b2070de5a
commit f4b5662562

View file

@ -32,6 +32,7 @@ namespace Render
void SelectionBuffer::setupRenderTarget()
{
mRenderTarget = mTexture->getBuffer()->getRenderTarget();
mRenderTarget->removeAllViewports();
Ogre::Viewport* vp = mRenderTarget->addViewport(mCamera);
vp->setOverlaysEnabled(false);
vp->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0));
@ -65,6 +66,7 @@ namespace Render
{
Ogre::MaterialManager::getSingleton ().addListener (this);
mTexture->load();
if (mRenderTarget == NULL)
setupRenderTarget();