#include <textrenderpool.h>
Public Member Functions | |
| TextRenderPool (size_t poolSize=200) | |
| ~TextRenderPool () | |
| void | invalidateCachedText () |
| Image * | getRenderedText (FontBase *fontbase, const std::string &text) |
| void | addRenderedText (FontBase *fontbase, const std::string &text, Image *image) |
| void | removeOldEntries () |
Generic pool for rendered text Caches a number of Images with text, as rendered by a Font. Makes sure no more than a maximum number of strings is pooled at a time. Automatically removes pooled strings not used for a minute. Doesn't use resources (apart from a minimum) if not used after a while.
std::map instead of a std::list Definition at line 53 of file textrenderpool.h.
| FIFE::TextRenderPool::TextRenderPool | ( | size_t | poolSize = 200 |
) |
Constructor Constructs a pool with a maximum of poolSize entries
Definition at line 42 of file textrenderpool.cpp.
References removeOldEntries().
| FIFE::TextRenderPool::~TextRenderPool | ( | ) |
Destructor
Definition at line 50 of file textrenderpool.cpp.
| void FIFE::TextRenderPool::addRenderedText | ( | FontBase * | fontbase, | |
| const std::string & | text, | |||
| Image * | image | |||
| ) |
Add a string image
Definition at line 87 of file textrenderpool.cpp.
References FIFE::FontBase::getColor(), FIFE::FontBase::getGlyphSpacing(), FIFE::FontBase::getRowSpacing(), and FIFE::FontBase::isAntiAlias().
Referenced by FIFE::FontBase::getAsImage(), and FIFE::FontBase::getAsImageMultiline().

Get a string image
Definition at line 57 of file textrenderpool.cpp.
References FIFE::FontBase::getColor(), FIFE::FontBase::getGlyphSpacing(), FIFE::FontBase::getRowSpacing(), and FIFE::FontBase::isAntiAlias().
Referenced by FIFE::FontBase::getAsImage(), and FIFE::FontBase::getAsImageMultiline().

| void FIFE::TextRenderPool::invalidateCachedText | ( | ) |
Invalidates all cached text images
Definition at line 134 of file textrenderpool.cpp.
| void FIFE::TextRenderPool::removeOldEntries | ( | ) |
Remove entries not used since a minute Is a timer callback.
Definition at line 114 of file textrenderpool.cpp.
Referenced by TextRenderPool().

1.6.3