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
/******************************************************************************/
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();
}
}
{
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 {