mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
parent
c8d3d11339
commit
ae9b5e0098
31 changed files with 428 additions and 523 deletions
|
@ -46,8 +46,8 @@ FontEngine::FontEngine(Settings* main_settings, gui::IGUIEnvironment* env) :
|
|||
m_env(env)
|
||||
{
|
||||
|
||||
for (unsigned int i = 0; i < FM_MaxMode; i++) {
|
||||
m_default_size[i] = (FontMode) FONT_SIZE_UNSPECIFIED;
|
||||
for (u32 &i : m_default_size) {
|
||||
i = (FontMode) FONT_SIZE_UNSPECIFIED;
|
||||
}
|
||||
|
||||
assert(m_settings != NULL); // pre-condition
|
||||
|
@ -113,15 +113,13 @@ FontEngine::~FontEngine()
|
|||
/******************************************************************************/
|
||||
void FontEngine::cleanCache()
|
||||
{
|
||||
for ( unsigned int i = 0; i < FM_MaxMode; i++) {
|
||||
for (auto &font_cache_it : m_font_cache) {
|
||||
|
||||
for (std::map<unsigned int, irr::gui::IGUIFont*>::iterator iter
|
||||
= m_font_cache[i].begin();
|
||||
iter != m_font_cache[i].end(); ++iter) {
|
||||
iter->second->drop();
|
||||
iter->second = NULL;
|
||||
for (auto &font_it : font_cache_it) {
|
||||
font_it.second->drop();
|
||||
font_it.second = NULL;
|
||||
}
|
||||
m_font_cache[i].clear();
|
||||
font_cache_it.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -370,7 +368,7 @@ void FontEngine::initSimpleFont(unsigned int basesize, FontMode mode)
|
|||
{
|
||||
assert(mode == FM_Simple || mode == FM_SimpleMono); // pre-condition
|
||||
|
||||
std::string font_path = "";
|
||||
std::string font_path;
|
||||
if (mode == FM_Simple) {
|
||||
font_path = m_settings->get("font_path");
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue