Move construction of WorkQueue to RenderingManager

coverity_scan
scrawl 9 years ago
parent d16450bff2
commit f9082502f8

@ -26,6 +26,7 @@
#include <components/sceneutil/lightmanager.hpp>
#include <components/sceneutil/statesetupdater.hpp>
#include <components/sceneutil/positionattitudetransform.hpp>
#include <components/sceneutil/workqueue.hpp>
#include <components/terrain/terraingrid.hpp>
@ -131,6 +132,7 @@ namespace MWRender
: mViewer(viewer)
, mRootNode(rootNode)
, mResourceSystem(resourceSystem)
, mWorkQueue(new SceneUtil::WorkQueue)
, mFogDepth(0.f)
, mUnderwaterColor(fallback->getFallbackColour("Water_UnderwaterColor"))
, mUnderwaterWeight(fallback->getFallbackFloat("Water_UnderwaterColorWeight"))
@ -231,6 +233,11 @@ namespace MWRender
return mResourceSystem;
}
SceneUtil::WorkQueue *RenderingManager::getWorkQueue()
{
return mWorkQueue.get();
}
void RenderingManager::clearCache()
{
if (mTerrain.get())

@ -42,6 +42,11 @@ namespace Fallback
class Map;
}
namespace SceneUtil
{
class WorkQueue;
}
namespace MWRender
{
@ -65,6 +70,8 @@ namespace MWRender
Resource::ResourceSystem* getResourceSystem();
SceneUtil::WorkQueue* getWorkQueue();
void clearCache();
double getReferenceTime() const;
@ -190,6 +197,8 @@ namespace MWRender
osg::ref_ptr<osg::Group> mLightRoot;
Resource::ResourceSystem* mResourceSystem;
osg::ref_ptr<SceneUtil::WorkQueue> mWorkQueue;
osg::ref_ptr<osg::Light> mSunLight;
std::auto_ptr<Pathgrid> mPathgrid;

@ -156,7 +156,6 @@ namespace MWWorld
, mBulletShapeManager(bulletShapeManager)
, mExpiryDelay(0.0)
{
mWorkQueue = new SceneUtil::WorkQueue;
}
void CellPreloader::preload(CellStore *cell, double timestamp)

@ -459,6 +459,7 @@ namespace MWWorld
, mPreloadEnabled(Settings::Manager::getBool("preload enabled", "Cells"))
{
mPreloader.reset(new CellPreloader(rendering.getResourceSystem(), physics->getShapeManager()));
mPreloader->setWorkQueue(mRendering.getWorkQueue());
float cacheExpiryDelay = Settings::Manager::getFloat("cache expiry delay", "Cells");
rendering.getResourceSystem()->setExpiryDelay(cacheExpiryDelay);

Loading…
Cancel
Save