Remove no longer required use of UnrefQueue as the new resource manager will naturally clear the cache from the worker thread

0.6.1
scrawl 8 years ago
parent 35d53acc65
commit 2c68ed4fb4

@ -218,7 +218,7 @@ namespace MWRender
Settings::Manager::getBool("auto use terrain normal maps", "Shaders"),
Settings::Manager::getString("terrain specular map pattern", "Shaders"), Settings::Manager::getBool("auto use terrain specular maps", "Shaders"));
mTerrain.reset(new Terrain::TerrainGrid(sceneRoot, mResourceSystem, mViewer->getIncrementalCompileOperation(),
mTerrainStorage, Mask_Terrain, &mResourceSystem->getSceneManager()->getShaderManager(), mUnrefQueue.get()));
mTerrainStorage, Mask_Terrain, &mResourceSystem->getSceneManager()->getShaderManager()));
mCamera.reset(new Camera(mViewer->getCamera()));

@ -5,18 +5,15 @@
#include <osg/Material>
#include <osg/Group>
#include <components/sceneutil/unrefqueue.hpp>
#include "texturemanager.hpp"
#include "chunkmanager.hpp"
namespace Terrain
{
TerrainGrid::TerrainGrid(osg::Group* parent, Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico, Storage* storage, int nodeMask, Shader::ShaderManager* shaderManager, SceneUtil::UnrefQueue* unrefQueue)
TerrainGrid::TerrainGrid(osg::Group* parent, Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico, Storage* storage, int nodeMask, Shader::ShaderManager* shaderManager)
: Terrain::World(parent, resourceSystem, ico, storage, nodeMask)
, mNumSplits(4)
, mUnrefQueue(unrefQueue)
, mShaderManager(shaderManager)
{
osg::ref_ptr<osg::Material> material (new osg::Material);
@ -92,9 +89,6 @@ void TerrainGrid::unloadCell(int x, int y)
osg::ref_ptr<osg::Node> terrainNode = it->second;
mTerrainRoot->removeChild(terrainNode);
if (mUnrefQueue.get())
mUnrefQueue->push(terrainNode);
mGrid.erase(it);
}

@ -7,11 +7,6 @@
#include "world.hpp"
namespace SceneUtil
{
class UnrefQueue;
}
namespace Shader
{
class ShaderManager;
@ -29,7 +24,7 @@ namespace Terrain
class TerrainGrid : public Terrain::World
{
public:
TerrainGrid(osg::Group* parent, Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico, Storage* storage, int nodeMask, Shader::ShaderManager* shaderManager = NULL, SceneUtil::UnrefQueue* unrefQueue = NULL);
TerrainGrid(osg::Group* parent, Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico, Storage* storage, int nodeMask, Shader::ShaderManager* shaderManager = NULL);
~TerrainGrid();
/// Load a terrain cell and store it in cache for later use.
@ -56,8 +51,6 @@ namespace Terrain
typedef std::map<std::pair<int, int>, osg::ref_ptr<osg::Node> > Grid;
Grid mGrid;
osg::ref_ptr<SceneUtil::UnrefQueue> mUnrefQueue;
Shader::ShaderManager* mShaderManager;
};

Loading…
Cancel
Save