mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-08 16:53:52 +01:00
Remove unused IVideoDriver::getTextureByIndex and IVideoDriver::renameTexture
* getTextureByIndex is pretty useless (apart from iterating over all texture, which we don't do), as you can't get an id. * renameTexture is broken anyway: The sort call does nothing because the array is still flagged as sorted.
This commit is contained in:
parent
b7292226b4
commit
03fd4ff533
@ -265,24 +265,10 @@ namespace video
|
|||||||
IReferenceCounted::drop() for more information. */
|
IReferenceCounted::drop() for more information. */
|
||||||
virtual ITexture* getTexture(io::IReadFile* file) =0;
|
virtual ITexture* getTexture(io::IReadFile* file) =0;
|
||||||
|
|
||||||
//! Returns a texture by index
|
|
||||||
/** \param index: Index of the texture, must be smaller than
|
|
||||||
getTextureCount() Please note that this index might change when
|
|
||||||
adding or removing textures
|
|
||||||
\return Pointer to the texture, or 0 if the texture was not
|
|
||||||
set or index is out of bounds. This pointer should not be
|
|
||||||
dropped. See IReferenceCounted::drop() for more information. */
|
|
||||||
virtual ITexture* getTextureByIndex(u32 index) =0;
|
|
||||||
|
|
||||||
//! Returns amount of textures currently loaded
|
//! Returns amount of textures currently loaded
|
||||||
/** \return Amount of textures currently loaded */
|
/** \return Amount of textures currently loaded */
|
||||||
virtual u32 getTextureCount() const = 0;
|
virtual u32 getTextureCount() const = 0;
|
||||||
|
|
||||||
//! Renames a texture
|
|
||||||
/** \param texture Pointer to the texture to rename.
|
|
||||||
\param newName New name for the texture. This should be a unique name. */
|
|
||||||
virtual void renameTexture(ITexture* texture, const io::path& newName) = 0;
|
|
||||||
|
|
||||||
//! Creates an empty texture of specified size.
|
//! Creates an empty texture of specified size.
|
||||||
/** \param size: Size of the texture.
|
/** \param size: Size of the texture.
|
||||||
\param name A name for the texture. Later calls to
|
\param name A name for the texture. Later calls to
|
||||||
|
@ -303,16 +303,6 @@ void CNullDriver::removeAllTextures()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! Returns a texture by index
|
|
||||||
ITexture* CNullDriver::getTextureByIndex(u32 i)
|
|
||||||
{
|
|
||||||
if ( i < Textures.size() )
|
|
||||||
return Textures[i].Surface;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! Returns amount of textures currently loaded
|
//! Returns amount of textures currently loaded
|
||||||
u32 CNullDriver::getTextureCount() const
|
u32 CNullDriver::getTextureCount() const
|
||||||
{
|
{
|
||||||
@ -320,19 +310,6 @@ u32 CNullDriver::getTextureCount() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! Renames a texture
|
|
||||||
void CNullDriver::renameTexture(ITexture* texture, const io::path& newName)
|
|
||||||
{
|
|
||||||
// we can do a const_cast here safely, the name of the ITexture interface
|
|
||||||
// is just readonly to prevent the user changing the texture name without invoking
|
|
||||||
// this method, because the textures will need resorting afterwards
|
|
||||||
|
|
||||||
io::SNamedPath& name = const_cast<io::SNamedPath&>(texture->getName());
|
|
||||||
name.setPath(newName);
|
|
||||||
|
|
||||||
Textures.sort();
|
|
||||||
}
|
|
||||||
|
|
||||||
ITexture* CNullDriver::addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format)
|
ITexture* CNullDriver::addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format)
|
||||||
{
|
{
|
||||||
if (0 == name.size())
|
if (0 == name.size())
|
||||||
|
@ -79,15 +79,9 @@ namespace video
|
|||||||
//! loads a Texture
|
//! loads a Texture
|
||||||
ITexture* getTexture(io::IReadFile* file) override;
|
ITexture* getTexture(io::IReadFile* file) override;
|
||||||
|
|
||||||
//! Returns a texture by index
|
|
||||||
ITexture* getTextureByIndex(u32 index) override;
|
|
||||||
|
|
||||||
//! Returns amount of textures currently loaded
|
//! Returns amount of textures currently loaded
|
||||||
u32 getTextureCount() const override;
|
u32 getTextureCount() const override;
|
||||||
|
|
||||||
//! Renames a texture
|
|
||||||
void renameTexture(ITexture* texture, const io::path& newName) override;
|
|
||||||
|
|
||||||
ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override;
|
ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override;
|
||||||
|
|
||||||
ITexture* addTexture(const io::path& name, IImage* image) override;
|
ITexture* addTexture(const io::path& name, IImage* image) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user