From 9e5225bb6f952b50402063783374ffcd7a91be23 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 5 Feb 2016 23:21:54 +0100 Subject: [PATCH] Do not unref a Texture's image data after applying it --- apps/openmw/engine.cpp | 2 +- components/terrain/terraingrid.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index d96bf16e4e..d30d0961aa 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -448,7 +448,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings) VFS::registerArchives(mVFS.get(), mFileCollections, mArchives, true); mResourceSystem.reset(new Resource::ResourceSystem(mVFS.get())); - mResourceSystem->getSceneManager()->setUnRefImageDataAfterApply(true); + mResourceSystem->getSceneManager()->setUnRefImageDataAfterApply(false); // keep to Off for now to allow better state sharing mResourceSystem->getSceneManager()->setFilterSettings( Settings::Manager::getString("texture mag filter", "General"), Settings::Manager::getString("texture min filter", "General"), diff --git a/components/terrain/terraingrid.cpp b/components/terrain/terraingrid.cpp index 2efbf1b9ea..eb085ca426 100644 --- a/components/terrain/terraingrid.cpp +++ b/components/terrain/terraingrid.cpp @@ -166,10 +166,6 @@ osg::ref_ptr TerrainGrid::buildTerrain (osg::Group* parent, float chu textureCompileDummy->getOrCreateStateSet()->setTextureAttributeAndModes(dummyTextureCounter++, blendmapTextures.back()); } - // SharedStatemanager->share(textureCompileDummy); - - // Remove unrefImageDataAfterApply for better state sharing - // use texture coordinates for both texture units, the layer texture and blend texture for (unsigned int i=0; i<2; ++i) geometry->setTexCoordArray(i, mCache.getUVBuffer());