mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:23:53 +00:00
Rename TextureManager to ImageManager
This commit is contained in:
parent
6ef848b7c5
commit
f99f403dda
23 changed files with 63 additions and 63 deletions
|
@ -28,7 +28,7 @@
|
||||||
#include <components/fontloader/fontloader.hpp>
|
#include <components/fontloader/fontloader.hpp>
|
||||||
|
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
|
|
||||||
#include <components/translation/translation.hpp>
|
#include <components/translation/translation.hpp>
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/resource/scenemanager.hpp>
|
#include <components/resource/scenemanager.hpp>
|
||||||
#include <components/resource/keyframemanager.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/nifloader.hpp> // KeyframeHolder
|
||||||
#include <components/nifosg/controller.hpp>
|
#include <components/nifosg/controller.hpp>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
|
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
#include <components/resource/scenemanager.hpp>
|
#include <components/resource/scenemanager.hpp>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/settings.hpp>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
#include <components/nifosg/controller.hpp>
|
#include <components/nifosg/controller.hpp>
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/resource/scenemanager.hpp>
|
#include <components/resource/scenemanager.hpp>
|
||||||
#include <components/fallback/fallback.hpp>
|
#include <components/fallback/fallback.hpp>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
|
|
||||||
#include <components/resource/scenemanager.hpp>
|
#include <components/resource/scenemanager.hpp>
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
|
|
||||||
#include <components/vfs/manager.hpp>
|
#include <components/vfs/manager.hpp>
|
||||||
#include <components/fallback/fallback.hpp>
|
#include <components/fallback/fallback.hpp>
|
||||||
|
@ -134,7 +134,7 @@ private:
|
||||||
class AtmosphereNightUpdater : public SceneUtil::StateSetUpdater
|
class AtmosphereNightUpdater : public SceneUtil::StateSetUpdater
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AtmosphereNightUpdater(Resource::TextureManager* textureManager)
|
AtmosphereNightUpdater(Resource::ImageManager* textureManager)
|
||||||
{
|
{
|
||||||
// we just need a texture, its contents don't really matter
|
// we just need a texture, its contents don't really matter
|
||||||
mTexture = textureManager->getWarningTexture();
|
mTexture = textureManager->getWarningTexture();
|
||||||
|
@ -469,7 +469,7 @@ const float CelestialBody::mDistance = 1000.0f;
|
||||||
class Sun : public CelestialBody
|
class Sun : public CelestialBody
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sun(osg::Group* parentNode, Resource::TextureManager& textureManager)
|
Sun(osg::Group* parentNode, Resource::ImageManager& textureManager)
|
||||||
: CelestialBody(parentNode, 1.0f, 1)
|
: CelestialBody(parentNode, 1.0f, 1)
|
||||||
, mUpdater(new Updater)
|
, mUpdater(new Updater)
|
||||||
{
|
{
|
||||||
|
@ -602,7 +602,7 @@ private:
|
||||||
return oqn;
|
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")));
|
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);
|
tex->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
|
||||||
|
@ -932,7 +932,7 @@ public:
|
||||||
Type_Secunda
|
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)
|
: CelestialBody(parentNode, scaleFactor, 2)
|
||||||
, mType(type)
|
, mType(type)
|
||||||
, mPhase(MoonState::Phase_Unspecified)
|
, mPhase(MoonState::Phase_Unspecified)
|
||||||
|
@ -1001,7 +1001,7 @@ public:
|
||||||
private:
|
private:
|
||||||
struct Updater : public SceneUtil::StateSetUpdater
|
struct Updater : public SceneUtil::StateSetUpdater
|
||||||
{
|
{
|
||||||
Resource::TextureManager& mTextureManager;
|
Resource::ImageManager& mTextureManager;
|
||||||
osg::ref_ptr<osg::Texture2D> mPhaseTex;
|
osg::ref_ptr<osg::Texture2D> mPhaseTex;
|
||||||
osg::ref_ptr<osg::Texture2D> mCircleTex;
|
osg::ref_ptr<osg::Texture2D> mCircleTex;
|
||||||
float mTransparency;
|
float mTransparency;
|
||||||
|
@ -1009,7 +1009,7 @@ private:
|
||||||
osg::Vec4f mAtmosphereColor;
|
osg::Vec4f mAtmosphereColor;
|
||||||
osg::Vec4f mMoonColor;
|
osg::Vec4f mMoonColor;
|
||||||
|
|
||||||
Updater(Resource::TextureManager& textureManager)
|
Updater(Resource::ImageManager& textureManager)
|
||||||
: mTextureManager(textureManager)
|
: mTextureManager(textureManager)
|
||||||
, mPhaseTex()
|
, mPhaseTex()
|
||||||
, mCircleTex()
|
, mCircleTex()
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <osg/Node>
|
#include <osg/Node>
|
||||||
|
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <osgUtil/CullVisitor>
|
#include <osgUtil/CullVisitor>
|
||||||
|
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
|
|
||||||
#include <components/nifosg/controller.hpp>
|
#include <components/nifosg/controller.hpp>
|
||||||
#include <components/sceneutil/controller.hpp>
|
#include <components/sceneutil/controller.hpp>
|
||||||
|
|
|
@ -41,7 +41,7 @@ add_component_dir (vfs
|
||||||
)
|
)
|
||||||
|
|
||||||
add_component_dir (resource
|
add_component_dir (resource
|
||||||
scenemanager keyframemanager texturemanager resourcesystem bulletshapemanager bulletshape niffilemanager objectcache
|
scenemanager keyframemanager imagemanager resourcesystem bulletshapemanager bulletshape niffilemanager objectcache
|
||||||
)
|
)
|
||||||
|
|
||||||
add_component_dir (sceneutil
|
add_component_dir (sceneutil
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
namespace osgMyGUI
|
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)
|
: mRenderManager(nullptr)
|
||||||
, mDataManager(nullptr)
|
, mDataManager(nullptr)
|
||||||
, mLogManager(nullptr)
|
, mLogManager(nullptr)
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace osg
|
||||||
}
|
}
|
||||||
namespace Resource
|
namespace Resource
|
||||||
{
|
{
|
||||||
class TextureManager;
|
class ImageManager;
|
||||||
}
|
}
|
||||||
namespace MyGUI
|
namespace MyGUI
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ namespace osgMyGUI
|
||||||
class Platform
|
class Platform
|
||||||
{
|
{
|
||||||
public:
|
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();
|
~Platform();
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include <osgGA/GUIEventHandler>
|
#include <osgGA/GUIEventHandler>
|
||||||
|
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
|
|
||||||
#include "myguitexture.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)
|
: mViewer(viewer)
|
||||||
, mSceneRoot(sceneroot)
|
, mSceneRoot(sceneroot)
|
||||||
, mTextureManager(textureManager)
|
, mTextureManager(textureManager)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Resource
|
namespace Resource
|
||||||
{
|
{
|
||||||
class TextureManager;
|
class ImageManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace osgViewer
|
namespace osgViewer
|
||||||
|
@ -33,7 +33,7 @@ class RenderManager : public MyGUI::RenderManager, public MyGUI::IRenderTarget
|
||||||
osg::ref_ptr<osgViewer::Viewer> mViewer;
|
osg::ref_ptr<osgViewer::Viewer> mViewer;
|
||||||
osg::ref_ptr<osg::Group> mSceneRoot;
|
osg::ref_ptr<osg::Group> mSceneRoot;
|
||||||
osg::ref_ptr<Drawable> mDrawable;
|
osg::ref_ptr<Drawable> mDrawable;
|
||||||
Resource::TextureManager* mTextureManager;
|
Resource::ImageManager* mTextureManager;
|
||||||
|
|
||||||
MyGUI::IntSize mViewSize;
|
MyGUI::IntSize mViewSize;
|
||||||
bool mUpdate;
|
bool mUpdate;
|
||||||
|
@ -54,7 +54,7 @@ class RenderManager : public MyGUI::RenderManager, public MyGUI::IRenderTarget
|
||||||
void destroyAllResources();
|
void destroyAllResources();
|
||||||
|
|
||||||
public:
|
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();
|
virtual ~RenderManager();
|
||||||
|
|
||||||
void initialise();
|
void initialise();
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
|
|
||||||
#include <osg/Texture2D>
|
#include <osg/Texture2D>
|
||||||
|
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
|
|
||||||
namespace osgMyGUI
|
namespace osgMyGUI
|
||||||
{
|
{
|
||||||
|
|
||||||
OSGTexture::OSGTexture(const std::string &name, Resource::TextureManager* textureManager)
|
OSGTexture::OSGTexture(const std::string &name, Resource::ImageManager* textureManager)
|
||||||
: mName(name)
|
: mName(name)
|
||||||
, mTextureManager(textureManager)
|
, mTextureManager(textureManager)
|
||||||
, mFormat(MyGUI::PixelFormat::Unknow)
|
, mFormat(MyGUI::PixelFormat::Unknow)
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace osg
|
||||||
|
|
||||||
namespace Resource
|
namespace Resource
|
||||||
{
|
{
|
||||||
class TextureManager;
|
class ImageManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace osgMyGUI
|
namespace osgMyGUI
|
||||||
|
@ -21,7 +21,7 @@ namespace osgMyGUI
|
||||||
|
|
||||||
class OSGTexture : public MyGUI::ITexture {
|
class OSGTexture : public MyGUI::ITexture {
|
||||||
std::string mName;
|
std::string mName;
|
||||||
Resource::TextureManager* mTextureManager;
|
Resource::ImageManager* mTextureManager;
|
||||||
|
|
||||||
osg::ref_ptr<osg::Image> mLockedImage;
|
osg::ref_ptr<osg::Image> mLockedImage;
|
||||||
osg::ref_ptr<osg::Texture2D> mTexture;
|
osg::ref_ptr<osg::Texture2D> mTexture;
|
||||||
|
@ -30,7 +30,7 @@ namespace osgMyGUI
|
||||||
size_t mNumElemBytes;
|
size_t mNumElemBytes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OSGTexture(const std::string &name, Resource::TextureManager* textureManager);
|
OSGTexture(const std::string &name, Resource::ImageManager* textureManager);
|
||||||
OSGTexture(osg::Texture2D* texture);
|
OSGTexture(osg::Texture2D* texture);
|
||||||
virtual ~OSGTexture();
|
virtual ~OSGTexture();
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// resource
|
// resource
|
||||||
#include <components/misc/stringops.hpp>
|
#include <components/misc/stringops.hpp>
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
|
|
||||||
// skel
|
// skel
|
||||||
#include <osgAnimation/MorphGeometry>
|
#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)
|
if (nif->numRoots() < 1)
|
||||||
nif->fail("Found no root nodes");
|
nif->fail("Found no root nodes");
|
||||||
|
@ -369,7 +369,7 @@ namespace NifOsg
|
||||||
return created;
|
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;
|
const Nif::PropertyList& props = nifNode->props;
|
||||||
for (size_t i = 0; i <props.length();++i)
|
for (size_t i = 0; i <props.length();++i)
|
||||||
|
@ -440,7 +440,7 @@ namespace NifOsg
|
||||||
return lod;
|
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)
|
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());
|
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)
|
for (Nif::ControllerPtr ctrl = texProperty->controller; !ctrl.empty(); ctrl = ctrl->next)
|
||||||
{
|
{
|
||||||
|
@ -1244,7 +1244,7 @@ namespace NifOsg
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleProperty(const Nif::Property *property,
|
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)
|
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());
|
LoaderImpl impl(file->getFilename());
|
||||||
return impl.load(file, textureManager);
|
return impl.load(file, textureManager);
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace osg
|
||||||
|
|
||||||
namespace Resource
|
namespace Resource
|
||||||
{
|
{
|
||||||
class TextureManager;
|
class ImageManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace NifOsg
|
namespace NifOsg
|
||||||
|
@ -62,7 +62,7 @@ namespace NifOsg
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Create a scene graph for the given NIF. Auto-detects when skinning is used and wraps the graph in a Skeleton if so.
|
/// 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.
|
/// Load keyframe controllers from the given kf file.
|
||||||
static void loadKf(Nif::NIFFilePtr kf, KeyframeHolder& target);
|
static void loadKf(Nif::NIFFilePtr kf, KeyframeHolder& target);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "texturemanager.hpp"
|
#include "imagemanager.hpp"
|
||||||
|
|
||||||
#include <osgDB/Registry>
|
#include <osgDB/Registry>
|
||||||
#include <osg/GLExtensions>
|
#include <osg/GLExtensions>
|
||||||
|
@ -42,7 +42,7 @@ namespace
|
||||||
namespace Resource
|
namespace Resource
|
||||||
{
|
{
|
||||||
|
|
||||||
TextureManager::TextureManager(const VFS::Manager *vfs)
|
ImageManager::ImageManager(const VFS::Manager *vfs)
|
||||||
: mVFS(vfs)
|
: mVFS(vfs)
|
||||||
, mWarningTexture(createWarningTexture())
|
, mWarningTexture(createWarningTexture())
|
||||||
, mWarningImage(mWarningTexture->getImage())
|
, mWarningImage(mWarningTexture->getImage())
|
||||||
|
@ -50,7 +50,7 @@ namespace Resource
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureManager::~TextureManager()
|
ImageManager::~ImageManager()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ namespace Resource
|
||||||
return true;
|
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;
|
std::string normalized = filename;
|
||||||
mVFS->normalizeFilename(normalized);
|
mVFS->normalizeFilename(normalized);
|
||||||
|
@ -137,7 +137,7 @@ namespace Resource
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Texture2D* TextureManager::getWarningTexture()
|
osg::Texture2D* ImageManager::getWarningTexture()
|
||||||
{
|
{
|
||||||
return mWarningTexture.get();
|
return mWarningTexture.get();
|
||||||
}
|
}
|
|
@ -27,11 +27,11 @@ namespace Resource
|
||||||
{
|
{
|
||||||
|
|
||||||
/// @brief Handles loading/caching of Images.
|
/// @brief Handles loading/caching of Images.
|
||||||
class TextureManager
|
class ImageManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextureManager(const VFS::Manager* vfs);
|
ImageManager(const VFS::Manager* vfs);
|
||||||
~TextureManager();
|
~ImageManager();
|
||||||
|
|
||||||
/// Create or retrieve an Image
|
/// Create or retrieve an Image
|
||||||
/// Returns the dummy image if the given image is not found.
|
/// 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<osg::Image> mWarningImage;
|
||||||
osg::ref_ptr<osgDB::Options> mOptions;
|
osg::ref_ptr<osgDB::Options> mOptions;
|
||||||
|
|
||||||
TextureManager(const TextureManager&);
|
ImageManager(const ImageManager&);
|
||||||
void operator = (const TextureManager&);
|
void operator = (const ImageManager&);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
#include "resourcesystem.hpp"
|
#include "resourcesystem.hpp"
|
||||||
|
|
||||||
#include "scenemanager.hpp"
|
#include "scenemanager.hpp"
|
||||||
#include "texturemanager.hpp"
|
#include "imagemanager.hpp"
|
||||||
#include "niffilemanager.hpp"
|
#include "niffilemanager.hpp"
|
||||||
#include "keyframemanager.hpp"
|
#include "keyframemanager.hpp"
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ namespace Resource
|
||||||
{
|
{
|
||||||
mNifFileManager.reset(new NifFileManager(vfs));
|
mNifFileManager.reset(new NifFileManager(vfs));
|
||||||
mKeyframeManager.reset(new KeyframeManager(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()));
|
mSceneManager.reset(new SceneManager(vfs, mTextureManager.get(), mNifFileManager.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ namespace Resource
|
||||||
return mSceneManager.get();
|
return mSceneManager.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureManager* ResourceSystem::getTextureManager()
|
ImageManager* ResourceSystem::getTextureManager()
|
||||||
{
|
{
|
||||||
return mTextureManager.get();
|
return mTextureManager.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace Resource
|
||||||
{
|
{
|
||||||
|
|
||||||
class SceneManager;
|
class SceneManager;
|
||||||
class TextureManager;
|
class ImageManager;
|
||||||
class NifFileManager;
|
class NifFileManager;
|
||||||
class KeyframeManager;
|
class KeyframeManager;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace Resource
|
||||||
~ResourceSystem();
|
~ResourceSystem();
|
||||||
|
|
||||||
SceneManager* getSceneManager();
|
SceneManager* getSceneManager();
|
||||||
TextureManager* getTextureManager();
|
ImageManager* getTextureManager();
|
||||||
NifFileManager* getNifFileManager();
|
NifFileManager* getNifFileManager();
|
||||||
KeyframeManager* getKeyframeManager();
|
KeyframeManager* getKeyframeManager();
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace Resource
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::auto_ptr<SceneManager> mSceneManager;
|
std::auto_ptr<SceneManager> mSceneManager;
|
||||||
std::auto_ptr<TextureManager> mTextureManager;
|
std::auto_ptr<ImageManager> mTextureManager;
|
||||||
std::auto_ptr<NifFileManager> mNifFileManager;
|
std::auto_ptr<NifFileManager> mNifFileManager;
|
||||||
std::auto_ptr<KeyframeManager> mKeyframeManager;
|
std::auto_ptr<KeyframeManager> mKeyframeManager;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <components/sceneutil/util.hpp>
|
#include <components/sceneutil/util.hpp>
|
||||||
#include <components/sceneutil/controller.hpp>
|
#include <components/sceneutil/controller.hpp>
|
||||||
|
|
||||||
#include "texturemanager.hpp"
|
#include "imagemanager.hpp"
|
||||||
#include "niffilemanager.hpp"
|
#include "niffilemanager.hpp"
|
||||||
|
|
||||||
namespace
|
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)
|
: mVFS(vfs)
|
||||||
, mTextureManager(textureManager)
|
, mTextureManager(textureManager)
|
||||||
, mNifFileManager(nifFileManager)
|
, mNifFileManager(nifFileManager)
|
||||||
|
@ -249,7 +249,7 @@ namespace Resource
|
||||||
class ImageReadCallback : public osgDB::ReadFileCallback
|
class ImageReadCallback : public osgDB::ReadFileCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ImageReadCallback(Resource::TextureManager* textureMgr)
|
ImageReadCallback(Resource::ImageManager* textureMgr)
|
||||||
: mTextureManager(textureMgr)
|
: mTextureManager(textureMgr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ namespace Resource
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Resource::TextureManager* mTextureManager;
|
Resource::ImageManager* mTextureManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string getFileExtension(const std::string& file)
|
std::string getFileExtension(const std::string& file)
|
||||||
|
@ -278,7 +278,7 @@ namespace Resource
|
||||||
return std::string();
|
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);
|
std::string ext = getFileExtension(normalizedFilename);
|
||||||
if (ext == "nif")
|
if (ext == "nif")
|
||||||
|
@ -408,7 +408,7 @@ namespace Resource
|
||||||
return mVFS;
|
return mVFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
Resource::TextureManager* SceneManager::getTextureManager()
|
Resource::ImageManager* SceneManager::getTextureManager()
|
||||||
{
|
{
|
||||||
return mTextureManager;
|
return mTextureManager;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
namespace Resource
|
namespace Resource
|
||||||
{
|
{
|
||||||
class TextureManager;
|
class ImageManager;
|
||||||
class NifFileManager;
|
class NifFileManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ namespace Resource
|
||||||
class SceneManager
|
class SceneManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SceneManager(const VFS::Manager* vfs, Resource::TextureManager* textureManager, Resource::NifFileManager* nifFileManager);
|
SceneManager(const VFS::Manager* vfs, Resource::ImageManager* textureManager, Resource::NifFileManager* nifFileManager);
|
||||||
~SceneManager();
|
~SceneManager();
|
||||||
|
|
||||||
/// Get a read-only copy of this scene "template"
|
/// Get a read-only copy of this scene "template"
|
||||||
|
@ -70,7 +70,7 @@ namespace Resource
|
||||||
|
|
||||||
const VFS::Manager* getVFS() const;
|
const VFS::Manager* getVFS() const;
|
||||||
|
|
||||||
Resource::TextureManager* getTextureManager();
|
Resource::ImageManager* getTextureManager();
|
||||||
|
|
||||||
/// @param mask The node mask to apply to loaded particle system nodes.
|
/// @param mask The node mask to apply to loaded particle system nodes.
|
||||||
void setParticleSystemMask(unsigned int mask);
|
void setParticleSystemMask(unsigned int mask);
|
||||||
|
@ -89,7 +89,7 @@ namespace Resource
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const VFS::Manager* mVFS;
|
const VFS::Manager* mVFS;
|
||||||
Resource::TextureManager* mTextureManager;
|
Resource::ImageManager* mTextureManager;
|
||||||
Resource::NifFileManager* mNifFileManager;
|
Resource::NifFileManager* mNifFileManager;
|
||||||
|
|
||||||
osg::Texture::FilterMode mMinFilter;
|
osg::Texture::FilterMode mMinFilter;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <components/resource/resourcesystem.hpp>
|
#include <components/resource/resourcesystem.hpp>
|
||||||
#include <components/resource/texturemanager.hpp>
|
#include <components/resource/imagemanager.hpp>
|
||||||
#include <components/resource/scenemanager.hpp>
|
#include <components/resource/scenemanager.hpp>
|
||||||
|
|
||||||
#include <components/sceneutil/lightmanager.hpp>
|
#include <components/sceneutil/lightmanager.hpp>
|
||||||
|
|
Loading…
Reference in a new issue