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

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

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

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

Loading…
Cancel
Save