Make reportStats const

0.6.1
scrawl 8 years ago
parent 5fb854036d
commit 051c17a184

@ -39,7 +39,7 @@ osg::ref_ptr<ESMTerrain::LandObject> LandManager::getLand(int x, int y)
}
}
void LandManager::reportStats(unsigned int frameNumber, osg::Stats *stats)
void LandManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
stats->setAttribute(frameNumber, "Land", mCache->getCacheSize());
}

@ -22,7 +22,7 @@ namespace MWRender
/// @note Will return NULL if not found.
osg::ref_ptr<ESMTerrain::LandObject> getLand(int x, int y);
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats);
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
private:
int mLoadFlags;

@ -907,7 +907,7 @@ namespace MWRender
mStateUpdater->setFogColor(color);
}
void RenderingManager::reportStats()
void RenderingManager::reportStats() const
{
osg::Stats* stats = mViewer->getViewerStats();
unsigned int frameNumber = mViewer->getFrameStamp()->getFrameNumber();

@ -200,7 +200,7 @@ namespace MWRender
void updateAmbient();
void setFogColor(const osg::Vec4f& color);
void reportStats();
void reportStats() const;
osg::ref_ptr<osgViewer::Viewer> mViewer;
osg::ref_ptr<osg::Group> mRootNode;

@ -185,7 +185,7 @@ void BulletShapeManager::updateCache(double referenceTime)
mInstanceCache->removeUnreferencedObjectsInCache();
}
void BulletShapeManager::reportStats(unsigned int frameNumber, osg::Stats *stats)
void BulletShapeManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
stats->setAttribute(frameNumber, "Shape", mCache->getCacheSize());
stats->setAttribute(frameNumber, "Shape Instance", mInstanceCache->getCacheSize());

@ -42,7 +42,7 @@ namespace Resource
/// @see ResourceManager::updateCache
virtual void updateCache(double referenceTime);
void reportStats(unsigned int frameNumber, osg::Stats *stats);
void reportStats(unsigned int frameNumber, osg::Stats *stats) const;
private:
osg::ref_ptr<BulletShapeInstance> createInstance(const std::string& name);

@ -141,7 +141,7 @@ namespace Resource
return mWarningImage;
}
void ImageManager::reportStats(unsigned int frameNumber, osg::Stats *stats)
void ImageManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
stats->setAttribute(frameNumber, "Image", mCache->getCacheSize());
}

@ -32,7 +32,7 @@ namespace Resource
osg::Image* getWarningImage();
void reportStats(unsigned int frameNumber, osg::Stats* stats);
void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
private:
osg::ref_ptr<osg::Image> mWarningImage;

@ -34,7 +34,7 @@ namespace Resource
}
}
void KeyframeManager::reportStats(unsigned int frameNumber, osg::Stats *stats)
void KeyframeManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
stats->setAttribute(frameNumber, "Keyframe", mCache->getCacheSize());
}

@ -23,7 +23,7 @@ namespace Resource
/// @note Throws an exception if the resource is not found.
osg::ref_ptr<const NifOsg::KeyframeHolder> get(const std::string& name);
void reportStats(unsigned int frameNumber, osg::Stats* stats);
void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
};
}

@ -56,7 +56,7 @@ namespace Resource
}
}
void NifFileManager::reportStats(unsigned int frameNumber, osg::Stats *stats)
void NifFileManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
stats->setAttribute(frameNumber, "Nif", mCache->getCacheSize());
}

@ -23,7 +23,7 @@ namespace Resource
/// to be done in advance by other managers accessing the NifFileManager.
Nif::NIFFilePtr get(const std::string& name);
void reportStats(unsigned int frameNumber, osg::Stats *stats);
void reportStats(unsigned int frameNumber, osg::Stats *stats) const;
};
}

@ -33,7 +33,7 @@ namespace Resource
const VFS::Manager* getVFS() const;
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) {}
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const {}
protected:
const VFS::Manager* mVFS;

@ -85,9 +85,9 @@ namespace Resource
return mVFS;
}
void ResourceSystem::reportStats(unsigned int frameNumber, osg::Stats *stats)
void ResourceSystem::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
for (std::vector<ResourceManager*>::iterator it = mResourceManagers.begin(); it != mResourceManagers.end(); ++it)
for (std::vector<ResourceManager*>::const_iterator it = mResourceManagers.begin(); it != mResourceManagers.end(); ++it)
(*it)->reportStats(frameNumber, stats);
}

@ -54,7 +54,7 @@ namespace Resource
/// @note May be called from any thread.
const VFS::Manager* getVFS() const;
void reportStats(unsigned int frameNumber, osg::Stats* stats);
void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
private:
std::auto_ptr<SceneManager> mSceneManager;

@ -703,7 +703,7 @@ namespace Resource
mSharedStateMutex.unlock();
}
void SceneManager::reportStats(unsigned int frameNumber, osg::Stats *stats)
void SceneManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*mIncrementalCompileOperation->getToCompiledMutex());

@ -143,7 +143,7 @@ namespace Resource
/// @see ResourceManager::updateCache
virtual void updateCache(double referenceTime);
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats);
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
private:
@ -160,7 +160,7 @@ namespace Resource
osg::ref_ptr<MultiObjectCache> mInstanceCache;
osg::ref_ptr<Resource::SharedStateManager> mSharedStateManager;
OpenThreads::Mutex mSharedStateMutex;
mutable OpenThreads::Mutex mSharedStateMutex;
Resource::ImageManager* mImageManager;
Resource::NifFileManager* mNifFileManager;

@ -71,7 +71,7 @@ void ChunkManager::setShaderManager(Shader::ShaderManager *shaderManager)
mShaderManager = shaderManager;
}
void ChunkManager::reportStats(unsigned int frameNumber, osg::Stats *stats)
void ChunkManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
stats->setAttribute(frameNumber, "Terrain Chunk", mCache->getCacheSize());
}

@ -42,7 +42,7 @@ namespace Terrain
// Optional
void setShaderManager(Shader::ShaderManager* shaderManager);
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats);
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
private:
osg::ref_ptr<osg::Node> createChunk(float size, const osg::Vec2f& center);

@ -54,7 +54,7 @@ osg::ref_ptr<osg::Texture2D> TextureManager::getTexture(const std::string &name)
}
}
void TextureManager::reportStats(unsigned int frameNumber, osg::Stats *stats)
void TextureManager::reportStats(unsigned int frameNumber, osg::Stats *stats) const
{
stats->setAttribute(frameNumber, "Terrain Texture", mCache->getCacheSize());
}

@ -27,7 +27,7 @@ namespace Terrain
osg::ref_ptr<osg::Texture2D> getTexture(const std::string& name);
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats);
virtual void reportStats(unsigned int frameNumber, osg::Stats* stats) const;
private:
Resource::SceneManager* mSceneManager;

Loading…
Cancel
Save