with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+
#include "fontengine.h"
-#include "log.h"
+#include "client/renderingengine.h"
#include "config.h"
#include "porting.h"
-#include "constants.h"
#include "filesys.h"
#if USE_FREETYPE
#include "gettext.h"
-#include "xCGUITTFont.h"
+#include "irrlicht_changes/CGUITTFont.h"
#endif
/** maximum size distance for getting a "similar" font size */
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();
}
}
if (! is_yes(m_settings->get("freetype"))) {
return;
}
- unsigned int size = floor(
- porting::getDisplayDensity() *
- m_settings->getFloat("gui_scaling") *
- basesize);
+ unsigned int size = floor(RenderingEngine::getDisplayDensity() *
+ m_settings->getFloat("gui_scaling") * basesize);
u32 font_shadow = 0;
u32 font_shadow_alpha = 0;
{
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 {
basesize = DEFAULT_FONT_SIZE;
unsigned int size = floor(
- porting::getDisplayDensity() *
+ RenderingEngine::getDisplayDensity() *
m_settings->getFloat("gui_scaling") *
basesize);