Simplify IMeshTextureLoader interface - getRecentTextureName was not needed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4704 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2014-03-03 12:07:46 +00:00
parent bbc215fdc5
commit 6b4dc7c50a
4 changed files with 4 additions and 20 deletions

View File

@ -51,12 +51,6 @@ public:
\return Pointer to the texture. Returns 0 if loading failed.*/ \return Pointer to the texture. Returns 0 if loading failed.*/
virtual irr::video::ITexture* getTexture(const irr::io::path& textureName) = 0; virtual irr::video::ITexture* getTexture(const irr::io::path& textureName) = 0;
//! Check which texture-name was last recently used.
/** Usually you do not have to use this method, it is used internally by IMeshLoader's.
It's updated on getTexture calls. When those succeed this will return the full name which was
used to find the texture. Then getTexture failed it will contain the last name which was tried. */
virtual const irr::io::path& getRecentTextureName() const = 0;
//! Check if the last call to getTexture found a texture which was already cached. //! Check if the last call to getTexture found a texture which was already cached.
/** Usually you do not have to use this method, it is used internally by IMeshLoader's. /** Usually you do not have to use this method, it is used internally by IMeshLoader's.
This will only work when a) CheckForCachedTextures is set to true and b) getTexture was This will only work when a) CheckForCachedTextures is set to true and b) getTexture was

View File

@ -202,7 +202,8 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file)
if ( getMeshTextureLoader() ) if ( getMeshTextureLoader() )
{ {
me.Texture2 = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(name) : NULL; me.Texture2 = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(name) : NULL;
me.Texture2FileName = getMeshTextureLoader()->getRecentTextureName(); if ( me.Texture2 )
me.Texture2FileName = me.Texture2->getName();
} }
else else
me.Texture2FileName = name; me.Texture2FileName = name;
@ -215,7 +216,8 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file)
if ( getMeshTextureLoader() ) if ( getMeshTextureLoader() )
{ {
me.Texture1 = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(name) : NULL; me.Texture1 = getMeshTextureLoader() ? getMeshTextureLoader()->getTexture(name) : NULL;
me.Texture1FileName = getMeshTextureLoader()->getRecentTextureName(); if ( me.Texture1 )
me.Texture1FileName = me.Texture1->getName();
} }
else else
me.Texture1FileName = name; me.Texture1FileName = name;

View File

@ -111,12 +111,6 @@ irr::video::ITexture* CMeshTextureLoader::getTexture(const irr::io::path& textur
return NULL; return NULL;
} }
//! Check which texture-name was last recently used.
const irr::io::path& CMeshTextureLoader::getRecentTextureName() const
{
return TextureName;
}
//! Check if the last call to getTexture found a texture which was already cached. //! Check if the last call to getTexture found a texture which was already cached.
bool CMeshTextureLoader::wasRecentTextureInCache() const bool CMeshTextureLoader::wasRecentTextureInCache() const
{ {

View File

@ -35,12 +35,6 @@ public:
\return Pointer to the texture. Returns 0 if loading failed.*/ \return Pointer to the texture. Returns 0 if loading failed.*/
virtual irr::video::ITexture* getTexture(const irr::io::path& textureName) _IRR_OVERRIDE_; virtual irr::video::ITexture* getTexture(const irr::io::path& textureName) _IRR_OVERRIDE_;
//! Check which texture-name was last recently used.
/** Usually you do not have to use this method, it is used internally by IMeshLoader's.
It's updated on getTexture calls. When those succeed this will return the full name which was
used to find the texture. Then getTexture failed it will contain the last name which was tried. */
virtual const irr::io::path& getRecentTextureName() const _IRR_OVERRIDE_;
//! Check if the last call to getTexture found a texture which was already cached. //! Check if the last call to getTexture found a texture which was already cached.
/** Usually you do not have to use this method, it is used internally by IMeshLoader's. /** Usually you do not have to use this method, it is used internally by IMeshLoader's.
This will only work when a) CheckForCachedTextures is set to true and b) getTexture was This will only work when a) CheckForCachedTextures is set to true and b) getTexture was