Commit ac1d878a authored by cutealien's avatar cutealien

Add IGUIEnvironment::removeFont (requested regularly).

Note: Currently we still will have the font-texture for CGUIFont's in the cache afterward.
But that needs a more general mechanims that allows cleaning up textures easier when the last one has been removed.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3465 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 7e20fd0d
Changes in 1.8 (??.0?.2010)
- Add function IGUIEnvironment::removeFont
- Functions in IMeshCache expecting IAnimatedMesh* parameters removed as similar functions with IMesh* can be used since a while. Fixes also problems when IAnimatedMesh* got upcasted to IMesh*. (thx @ Greenya for reporting)
- The following functions will now use a "ISceneNode *" instead of a "const ISceneNode *":
......
......@@ -174,6 +174,9 @@ public:
\return Pointer to the font stored. This can differ from given parameter if the name previously existed. */
virtual IGUIFont* addFont(const io::path& name, IGUIFont* font) = 0;
//! remove loaded font
virtual void removeFont(IGUIFont* font) = 0;
//! Returns the default built-in font.
/** \return Pointer to the default built-in font.
This pointer should not be dropped. See IReferenceCounted::drop() for
......
......@@ -1481,6 +1481,21 @@ IGUIFont* CGUIEnvironment::addFont(const io::path& name, IGUIFont* font)
return font;
}
//! remove loaded font
void CGUIEnvironment::removeFont(IGUIFont* font)
{
if ( !font )
return;
for ( u32 i=0; i<Fonts.size(); ++i )
{
if ( Fonts[i].Font == font )
{
Fonts[i].Font->drop();
Fonts.erase(i);
return;
}
}
}
//! returns default font
IGUIFont* CGUIEnvironment::getBuiltInFont() const
......
......@@ -80,6 +80,9 @@ public:
//! add an externally loaded font
virtual IGUIFont* addFont(const io::path& name, IGUIFont* font);
//! remove loaded font
virtual void removeFont(IGUIFont* font);
//! returns default font
virtual IGUIFont* getBuiltInFont() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment