Rename TextureManager to ImageManager

coverity_scan
scrawl 9 years ago
parent 6ef848b7c5
commit f99f403dda

@ -28,7 +28,7 @@
#include <components/fontloader/fontloader.hpp>
#include <components/resource/resourcesystem.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include <components/translation/translation.hpp>

@ -19,7 +19,7 @@
#include <components/resource/resourcesystem.hpp>
#include <components/resource/scenemanager.hpp>
#include <components/resource/keyframemanager.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include <components/nifosg/nifloader.hpp> // KeyframeHolder
#include <components/nifosg/controller.hpp>

@ -17,7 +17,7 @@
#include <osgViewer/Viewer>
#include <components/resource/resourcesystem.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include <components/resource/scenemanager.hpp>
#include <components/settings/settings.hpp>

@ -13,7 +13,7 @@
#include <components/misc/rng.hpp>
#include <components/nifosg/controller.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include <components/resource/resourcesystem.hpp>
#include <components/resource/scenemanager.hpp>
#include <components/fallback/fallback.hpp>

@ -31,7 +31,7 @@
#include <components/misc/resourcehelpers.hpp>
#include <components/resource/scenemanager.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include <components/vfs/manager.hpp>
#include <components/fallback/fallback.hpp>
@ -134,7 +134,7 @@ private:
class AtmosphereNightUpdater : public SceneUtil::StateSetUpdater
{
public:
AtmosphereNightUpdater(Resource::TextureManager* textureManager)
AtmosphereNightUpdater(Resource::ImageManager* textureManager)
{
// we just need a texture, its contents don't really matter
mTexture = textureManager->getWarningTexture();
@ -469,7 +469,7 @@ const float CelestialBody::mDistance = 1000.0f;
class Sun : public CelestialBody
{
public:
Sun(osg::Group* parentNode, Resource::TextureManager& textureManager)
Sun(osg::Group* parentNode, Resource::ImageManager& textureManager)
: CelestialBody(parentNode, 1.0f, 1)
, mUpdater(new Updater)
{
@ -602,7 +602,7 @@ private:
return oqn;
}
void createSunFlash(Resource::TextureManager& textureManager)
void createSunFlash(Resource::ImageManager& textureManager)
{
osg::ref_ptr<osg::Texture2D> tex (new osg::Texture2D(textureManager.getImage("textures/tx_sun_flash_grey_05.dds")));
tex->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
@ -932,7 +932,7 @@ public:
Type_Secunda
};
Moon(osg::Group* parentNode, Resource::TextureManager& textureManager, float scaleFactor, Type type)
Moon(osg::Group* parentNode, Resource::ImageManager& textureManager, float scaleFactor, Type type)
: CelestialBody(parentNode, scaleFactor, 2)
, mType(type)
, mPhase(MoonState::Phase_Unspecified)
@ -1001,7 +1001,7 @@ public:
private:
struct Updater : public SceneUtil::StateSetUpdater
{
Resource::TextureManager& mTextureManager;
Resource::ImageManager& mTextureManager;
osg::ref_ptr<osg::Texture2D> mPhaseTex;
osg::ref_ptr<osg::Texture2D> mCircleTex;
float mTransparency;
@ -1009,7 +1009,7 @@ private:
osg::Vec4f mAtmosphereColor;
osg::Vec4f mMoonColor;
Updater(Resource::TextureManager& textureManager)
Updater(Resource::ImageManager& textureManager)
: mTextureManager(textureManager)
, mPhaseTex()
, mCircleTex()

@ -3,7 +3,7 @@
#include <osg/Node>
#include <components/resource/resourcesystem.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include <components/misc/resourcehelpers.hpp>
namespace MWRender

@ -25,7 +25,7 @@
#include <osgUtil/CullVisitor>
#include <components/resource/resourcesystem.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include <components/nifosg/controller.hpp>
#include <components/sceneutil/controller.hpp>

@ -41,7 +41,7 @@ add_component_dir (vfs
)
add_component_dir (resource
scenemanager keyframemanager texturemanager resourcesystem bulletshapemanager bulletshape niffilemanager objectcache
scenemanager keyframemanager imagemanager resourcesystem bulletshapemanager bulletshape niffilemanager objectcache
)
add_component_dir (sceneutil

@ -7,7 +7,7 @@
namespace osgMyGUI
{
Platform::Platform(osgViewer::Viewer *viewer, osg::Group *guiRoot, Resource::TextureManager *textureManager, float uiScalingFactor)
Platform::Platform(osgViewer::Viewer *viewer, osg::Group *guiRoot, Resource::ImageManager *textureManager, float uiScalingFactor)
: mRenderManager(nullptr)
, mDataManager(nullptr)
, mLogManager(nullptr)

@ -13,7 +13,7 @@ namespace osg
}
namespace Resource
{
class TextureManager;
class ImageManager;
}
namespace MyGUI
{
@ -30,7 +30,7 @@ namespace osgMyGUI
class Platform
{
public:
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager, float uiScalingFactor);
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ImageManager* textureManager, float uiScalingFactor);
~Platform();

@ -15,7 +15,7 @@
#include <osgGA/GUIEventHandler>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include "myguitexture.hpp"
@ -353,7 +353,7 @@ void OSGVertexBuffer::create()
// ---------------------------------------------------------------------------
RenderManager::RenderManager(osgViewer::Viewer *viewer, osg::Group *sceneroot, Resource::TextureManager* textureManager, float scalingFactor)
RenderManager::RenderManager(osgViewer::Viewer *viewer, osg::Group *sceneroot, Resource::ImageManager* textureManager, float scalingFactor)
: mViewer(viewer)
, mSceneRoot(sceneroot)
, mTextureManager(textureManager)

@ -7,7 +7,7 @@
namespace Resource
{
class TextureManager;
class ImageManager;
}
namespace osgViewer
@ -33,7 +33,7 @@ class RenderManager : public MyGUI::RenderManager, public MyGUI::IRenderTarget
osg::ref_ptr<osgViewer::Viewer> mViewer;
osg::ref_ptr<osg::Group> mSceneRoot;
osg::ref_ptr<Drawable> mDrawable;
Resource::TextureManager* mTextureManager;
Resource::ImageManager* mTextureManager;
MyGUI::IntSize mViewSize;
bool mUpdate;
@ -54,7 +54,7 @@ class RenderManager : public MyGUI::RenderManager, public MyGUI::IRenderTarget
void destroyAllResources();
public:
RenderManager(osgViewer::Viewer *viewer, osg::Group *sceneroot, Resource::TextureManager* textureManager, float scalingFactor);
RenderManager(osgViewer::Viewer *viewer, osg::Group *sceneroot, Resource::ImageManager* textureManager, float scalingFactor);
virtual ~RenderManager();
void initialise();

@ -5,12 +5,12 @@
#include <osg/Texture2D>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
namespace osgMyGUI
{
OSGTexture::OSGTexture(const std::string &name, Resource::TextureManager* textureManager)
OSGTexture::OSGTexture(const std::string &name, Resource::ImageManager* textureManager)
: mName(name)
, mTextureManager(textureManager)
, mFormat(MyGUI::PixelFormat::Unknow)

@ -13,7 +13,7 @@ namespace osg
namespace Resource
{
class TextureManager;
class ImageManager;
}
namespace osgMyGUI
@ -21,7 +21,7 @@ namespace osgMyGUI
class OSGTexture : public MyGUI::ITexture {
std::string mName;
Resource::TextureManager* mTextureManager;
Resource::ImageManager* mTextureManager;
osg::ref_ptr<osg::Image> mLockedImage;
osg::ref_ptr<osg::Texture2D> mTexture;
@ -30,7 +30,7 @@ namespace osgMyGUI
size_t mNumElemBytes;
public:
OSGTexture(const std::string &name, Resource::TextureManager* textureManager);
OSGTexture(const std::string &name, Resource::ImageManager* textureManager);
OSGTexture(osg::Texture2D* texture);
virtual ~OSGTexture();

@ -11,7 +11,7 @@
// resource
#include <components/misc/stringops.hpp>
#include <components/misc/resourcehelpers.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
// skel
#include <osgAnimation/MorphGeometry>
@ -343,7 +343,7 @@ namespace NifOsg
}
}
osg::ref_ptr<osg::Node> load(Nif::NIFFilePtr nif, Resource::TextureManager* textureManager)
osg::ref_ptr<osg::Node> load(Nif::NIFFilePtr nif, Resource::ImageManager* textureManager)
{
if (nif->numRoots() < 1)
nif->fail("Found no root nodes");
@ -369,7 +369,7 @@ namespace NifOsg
return created;
}
void applyNodeProperties(const Nif::Node *nifNode, osg::Node *applyTo, SceneUtil::CompositeStateSetUpdater* composite, Resource::TextureManager* textureManager, std::vector<int>& boundTextures, int animflags)
void applyNodeProperties(const Nif::Node *nifNode, osg::Node *applyTo, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* textureManager, std::vector<int>& boundTextures, int animflags)
{
const Nif::PropertyList& props = nifNode->props;
for (size_t i = 0; i <props.length();++i)
@ -440,7 +440,7 @@ namespace NifOsg
return lod;
}
osg::ref_ptr<osg::Node> handleNode(const Nif::Node* nifNode, osg::Group* parentNode, Resource::TextureManager* textureManager,
osg::ref_ptr<osg::Node> handleNode(const Nif::Node* nifNode, osg::Group* parentNode, Resource::ImageManager* textureManager,
std::vector<int> boundTextures, int animflags, int particleflags, bool skipMeshes, TextKeyMap* textKeys, osg::Node* rootNode=NULL)
{
osg::ref_ptr<osg::Group> node = new osg::MatrixTransform(nifNode->trafo.toMatrix());
@ -682,7 +682,7 @@ namespace NifOsg
}
}
void handleTextureControllers(const Nif::Property *texProperty, SceneUtil::CompositeStateSetUpdater* composite, Resource::TextureManager* textureManager, osg::StateSet *stateset, int animflags)
void handleTextureControllers(const Nif::Property *texProperty, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* textureManager, osg::StateSet *stateset, int animflags)
{
for (Nif::ControllerPtr ctrl = texProperty->controller; !ctrl.empty(); ctrl = ctrl->next)
{
@ -1244,7 +1244,7 @@ namespace NifOsg
}
void handleProperty(const Nif::Property *property,
osg::Node *node, SceneUtil::CompositeStateSetUpdater* composite, Resource::TextureManager* textureManager, std::vector<int>& boundTextures, int animflags)
osg::Node *node, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* textureManager, std::vector<int>& boundTextures, int animflags)
{
switch (property->recType)
{
@ -1543,7 +1543,7 @@ namespace NifOsg
};
osg::ref_ptr<osg::Node> Loader::load(Nif::NIFFilePtr file, Resource::TextureManager* textureManager)
osg::ref_ptr<osg::Node> Loader::load(Nif::NIFFilePtr file, Resource::ImageManager* textureManager)
{
LoaderImpl impl(file->getFilename());
return impl.load(file, textureManager);

@ -15,7 +15,7 @@ namespace osg
namespace Resource
{
class TextureManager;
class ImageManager;
}
namespace NifOsg
@ -62,7 +62,7 @@ namespace NifOsg
{
public:
/// Create a scene graph for the given NIF. Auto-detects when skinning is used and wraps the graph in a Skeleton if so.
static osg::ref_ptr<osg::Node> load(Nif::NIFFilePtr file, Resource::TextureManager* textureManager);
static osg::ref_ptr<osg::Node> load(Nif::NIFFilePtr file, Resource::ImageManager* textureManager);
/// Load keyframe controllers from the given kf file.
static void loadKf(Nif::NIFFilePtr kf, KeyframeHolder& target);

@ -1,4 +1,4 @@
#include "texturemanager.hpp"
#include "imagemanager.hpp"
#include <osgDB/Registry>
#include <osg/GLExtensions>
@ -42,7 +42,7 @@ namespace
namespace Resource
{
TextureManager::TextureManager(const VFS::Manager *vfs)
ImageManager::ImageManager(const VFS::Manager *vfs)
: mVFS(vfs)
, mWarningTexture(createWarningTexture())
, mWarningImage(mWarningTexture->getImage())
@ -50,7 +50,7 @@ namespace Resource
{
}
TextureManager::~TextureManager()
ImageManager::~ImageManager()
{
}
@ -88,7 +88,7 @@ namespace Resource
return true;
}
osg::ref_ptr<osg::Image> TextureManager::getImage(const std::string &filename)
osg::ref_ptr<osg::Image> ImageManager::getImage(const std::string &filename)
{
std::string normalized = filename;
mVFS->normalizeFilename(normalized);
@ -137,7 +137,7 @@ namespace Resource
}
}
osg::Texture2D* TextureManager::getWarningTexture()
osg::Texture2D* ImageManager::getWarningTexture()
{
return mWarningTexture.get();
}

@ -27,11 +27,11 @@ namespace Resource
{
/// @brief Handles loading/caching of Images.
class TextureManager
class ImageManager
{
public:
TextureManager(const VFS::Manager* vfs);
~TextureManager();
ImageManager(const VFS::Manager* vfs);
~ImageManager();
/// Create or retrieve an Image
/// Returns the dummy image if the given image is not found.
@ -51,8 +51,8 @@ namespace Resource
osg::ref_ptr<osg::Image> mWarningImage;
osg::ref_ptr<osgDB::Options> mOptions;
TextureManager(const TextureManager&);
void operator = (const TextureManager&);
ImageManager(const ImageManager&);
void operator = (const ImageManager&);
};
}

@ -1,7 +1,7 @@
#include "resourcesystem.hpp"
#include "scenemanager.hpp"
#include "texturemanager.hpp"
#include "imagemanager.hpp"
#include "niffilemanager.hpp"
#include "keyframemanager.hpp"
@ -13,7 +13,7 @@ namespace Resource
{
mNifFileManager.reset(new NifFileManager(vfs));
mKeyframeManager.reset(new KeyframeManager(vfs));
mTextureManager.reset(new TextureManager(vfs));
mTextureManager.reset(new ImageManager(vfs));
mSceneManager.reset(new SceneManager(vfs, mTextureManager.get(), mNifFileManager.get()));
}
@ -27,7 +27,7 @@ namespace Resource
return mSceneManager.get();
}
TextureManager* ResourceSystem::getTextureManager()
ImageManager* ResourceSystem::getTextureManager()
{
return mTextureManager.get();
}

@ -12,7 +12,7 @@ namespace Resource
{
class SceneManager;
class TextureManager;
class ImageManager;
class NifFileManager;
class KeyframeManager;
@ -26,7 +26,7 @@ namespace Resource
~ResourceSystem();
SceneManager* getSceneManager();
TextureManager* getTextureManager();
ImageManager* getTextureManager();
NifFileManager* getNifFileManager();
KeyframeManager* getKeyframeManager();
@ -37,7 +37,7 @@ namespace Resource
private:
std::auto_ptr<SceneManager> mSceneManager;
std::auto_ptr<TextureManager> mTextureManager;
std::auto_ptr<ImageManager> mTextureManager;
std::auto_ptr<NifFileManager> mNifFileManager;
std::auto_ptr<KeyframeManager> mKeyframeManager;

@ -24,7 +24,7 @@
#include <components/sceneutil/util.hpp>
#include <components/sceneutil/controller.hpp>
#include "texturemanager.hpp"
#include "imagemanager.hpp"
#include "niffilemanager.hpp"
namespace
@ -227,7 +227,7 @@ namespace Resource
SceneManager::SceneManager(const VFS::Manager *vfs, Resource::TextureManager* textureManager, Resource::NifFileManager* nifFileManager)
SceneManager::SceneManager(const VFS::Manager *vfs, Resource::ImageManager* textureManager, Resource::NifFileManager* nifFileManager)
: mVFS(vfs)
, mTextureManager(textureManager)
, mNifFileManager(nifFileManager)
@ -249,7 +249,7 @@ namespace Resource
class ImageReadCallback : public osgDB::ReadFileCallback
{
public:
ImageReadCallback(Resource::TextureManager* textureMgr)
ImageReadCallback(Resource::ImageManager* textureMgr)
: mTextureManager(textureMgr)
{
}
@ -267,7 +267,7 @@ namespace Resource
}
private:
Resource::TextureManager* mTextureManager;
Resource::ImageManager* mTextureManager;
};
std::string getFileExtension(const std::string& file)
@ -278,7 +278,7 @@ namespace Resource
return std::string();
}
osg::ref_ptr<osg::Node> load (Files::IStreamPtr file, const std::string& normalizedFilename, Resource::TextureManager* textureMgr, Resource::NifFileManager* nifFileManager)
osg::ref_ptr<osg::Node> load (Files::IStreamPtr file, const std::string& normalizedFilename, Resource::ImageManager* textureMgr, Resource::NifFileManager* nifFileManager)
{
std::string ext = getFileExtension(normalizedFilename);
if (ext == "nif")
@ -408,7 +408,7 @@ namespace Resource
return mVFS;
}
Resource::TextureManager* SceneManager::getTextureManager()
Resource::ImageManager* SceneManager::getTextureManager()
{
return mTextureManager;
}

@ -10,7 +10,7 @@
namespace Resource
{
class TextureManager;
class ImageManager;
class NifFileManager;
}
@ -36,7 +36,7 @@ namespace Resource
class SceneManager
{
public:
SceneManager(const VFS::Manager* vfs, Resource::TextureManager* textureManager, Resource::NifFileManager* nifFileManager);
SceneManager(const VFS::Manager* vfs, Resource::ImageManager* textureManager, Resource::NifFileManager* nifFileManager);
~SceneManager();
/// Get a read-only copy of this scene "template"
@ -70,7 +70,7 @@ namespace Resource
const VFS::Manager* getVFS() const;
Resource::TextureManager* getTextureManager();
Resource::ImageManager* getTextureManager();
/// @param mask The node mask to apply to loaded particle system nodes.
void setParticleSystemMask(unsigned int mask);
@ -89,7 +89,7 @@ namespace Resource
private:
const VFS::Manager* mVFS;
Resource::TextureManager* mTextureManager;
Resource::ImageManager* mTextureManager;
Resource::NifFileManager* mNifFileManager;
osg::Texture::FilterMode mMinFilter;

@ -3,7 +3,7 @@
#include <memory>
#include <components/resource/resourcesystem.hpp>
#include <components/resource/texturemanager.hpp>
#include <components/resource/imagemanager.hpp>
#include <components/resource/scenemanager.hpp>
#include <components/sceneutil/lightmanager.hpp>

Loading…
Cancel
Save